Current NDK support still works for simple projects (for example, C / C ++ sources independent of other pre-built NDK libraries), including when using the latest version of NDK r10d.
But this is really limited, and as the warning says, it is outdated, yes.
I recommend simply disabling it and making the gradle call ndk-build directly. This way you can save your classic Android.mk/Application.mk configuration files, and the ndk-build call from your project will still work the same as with the eclipse project:
import org.apache.tools.ant.taskdefs.condition.Os ... android { ... sourceSets.main { jniLibs.srcDir 'src/main/libs' //set .so files location to libs instead of jniLibs jni.srcDirs = [] //disable automatic ndk-build call } // add a task that calls regular ndk-build(.cmd) script from app directory task ndkBuild(type: Exec) { if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath } else { commandLine 'ndk-build', '-C', file('src/main').absolutePath } } // add this task as a dependency of Java compilation tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn ndkBuild } }
source share