I'm using the latest android studio build 1.1 ,since i want to import an eclipse project that needs NDK .i installed NDK and set the NDK location in the local.properties
.The problem is when i try to run the project 2 errors are displayed they are
1) Error:(199) *** Android NDK: Aborting... . Stop.
2)Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException: Process 'command 'C:\Users\vishal\android-ndk-r10d\ndk-build.cmd'' finished with non-zero exit value 2
any solution?
Try adding this to the build.gradle
file:
sourceSets.main {
jni.srcDirs = []
}
This solved my problem:
{approot}\app\src\main\jni
Add the following code to your app/gradle.build
file, in the android section. It should look like this:
android {
...
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
}
May be this is known NDK bug. Try to add empty .c file to your jni dir (like empty.c).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With