Reputation: 11
I've tried everything to solve this but I still can't. This is the build.gradle: app part that may be causing the problem:
task ndkBuild(type: Exec,description: 'run ndk-build') {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
workingDir 'jni'
commandLine 'ndk-build.cmd', '-j' , Runtime.runtime.availableProcessors()
} else {
workingDir 'jni'
commandLine "ndk-build", '-j', Runtime.runtime.availableProcessors()
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(ndkBuild)
}
I also changed this:
NDK_TOOLCHAIN_VERSION := 4.9 ( was 4.8)
And of course :
ndk.dir=C:\Users\Elyes\AppData\Local\Android\Sdk\ndk-bundle
sdk.dir=C:\Users\Elyes\AppData\Local\Android\Sdk
And it still doesn't work.
Upvotes: 1
Views: 654
Reputation: 6265
Im using the following command on windows pc
task buildNative(type: Exec) {
workingDir 'jni'// directory app/jni
commandLine("${android.ndkDirectory}\\ndk-build.cmd", '-j', Runtime.runtime.availableProcessors())
}
Upvotes: 1