Android NDK C print log on android studio 2.2? - android

Developing ndk programing. How to solve it error. Please give me
Error
Error:Execution failed for task ':app:linkAppArm64-v8aDebugSharedLibrary'.
A build operation failed.
Linker failed while linking libApp.so.
See the complete log at: file:///C:/android/NDKTutorialTwo/app/build/tmp/linkAppArm64-v8aDebugSharedLibrary/output.txt
Output.txt
See file:///C:/android/NDKTutorialTwo/app/build/tmp/linkAppArm64-v8aDebugSharedLibrary/output.txt for all output for linkAppArm64-v8aDebugSharedLibrary.
linking libApp.so failed.
C:/androidNDK/android-ndk-r12b/toolchains/aarch64-linux-android-4.9/prebuilt/windows/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.exe: cannot find -lmui
collect2.exe: error: ld returned 1 exit status
Finished linkAppArm64-v8aDebugSharedLibrary, see full log file:///C:/android/NDKTutorialTwo/app/build/tmp/linkAppArm64-v8aDebugSharedLibrary/output.txt.
App level Gradle
apply plugin: 'com.android.model.application'
model{
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.metroinfrasys.ndktutorialtwo"
minSdkVersion.apiLevel 16
targetSdkVersion.apiLevel 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles.add(file('proguard-android.txt'))
}
}
ndk {
moduleName "App"
ldLibs.add("EGL")
ldLibs.add("android")
ldLibs.add("GLESv2")
ldLibs.add("dl")
ldLibs.add("log")
ldLibs.add("mui")
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.0'
testCompile 'junit:junit:4.12'
}
Please give any solution

Related

Can't Create Project in android studio

Error:failed to create directory 'D:\rw_apps\MyApplication\app\build\generated\source\r\debug\com\example\bhavin\myapplication'
Error:java.util.concurrent.ExecutionException:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt
I tried lots of solution from other stackoverflow answers like
clean project,
restart android studio,
change build-tools,
re-download build-tools.
Run with --stacktrace are long so I share text file please check it.
I am using android studio 3.0 beta 6.
MY gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
Set android.enableAapt2=false in your gradle.properties file

Error:Invalid byte 1 of 1-byte UTF-8 sequence. in android studio

Getting below error in android studio.
Gradle sync failed: Invalid byte 1 of 1-byte UTF-8 sequence.
my gradle file is as below. i cannot find the solution. now the same error is getting in all my projects.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
testCompile 'junit:junit:4.12'
}
Got the same issue...
finally change my classpath in the project build.gradle ... for my case in example it was
com.android.tools.build:gradle:2.3.3
I first pass it to
com.android.tools.build:gradle:2.3.+
and once the gradle synced turn it back to
com.android.tools.build:gradle:2.3.3

Android studio 2.3.3 build error with gradle-3.3.3 and android-plugin-2.3.3

In android studio-2.3.3
Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
It's a hello world application.
How can I solve this error?
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.shibly.myapplication"
minSdkVersion 10
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
try to look in this :
Gradle on Android Studio loading with error
"I had the same problem. I fixed it by downgrading my build tools version from 24.0.1 to 23.0.3.
Download older build tool version from http://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip
, Extract the downloaded file and paste it in your SDK build-tools directory( mostly /home/user/Android/Sdk/build-tools)
,
Now in your app:gradle file change the buildToolsVersion to "23.0.3"
, Sync your gradle file and you should be good to go
Hope google fixes its build-tools bug"

Error while building Android project . "AAPT process not ready to receive commands"

I am using Ubuntu 14.04 32 bit os. And I update my Android Studio 2.2.2 to 2.3.3, after upgrading I can't build my projects. When I try to build my projects Android Studio always shows error like
Error:java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
this is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId "akhil.com.d4donline"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.wdullaer:materialdatetimepicker:2.3.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
This is a well knew bug in Linux, just downgrade the build version to 23:
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
. . .
defaultConfig {
. . .
targetSdkVersion 23
. . .
And you probably also have to change the gradle version to 2.2

After import to android studio, gradle task “app:dexDebug” fails

I have the following gradle file in my android app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.test.forum"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
//configurations {
// all*.exclude group: 'com.android.support', module: 'support-v4'
//}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19+'
compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
and the bug output is Error code: 2; Output: UNEXPECTED TOP-LEVEL EXCEPTION.
When I uncomment the configurations part of the file I get Can't find package v4 (support) although I have it installed from the sdk. Any ideas on how I can solve this?

Categories

Resources