I know how use custom Android.mk
with old gradle:
sourceSets.main {
jniLibs.srcDir 'src/main/jni'
jni.srcDirs = [] //disable automatic ndk-build call
}
// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
commandLine '/.../android-ndk-r10e/ndk-build', '-C', file('src/main').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
It's not working with new gradle: com.android.tools.build:gradle-experimental:0.2.0
:
Error:Cause: com.android.build.gradle.managed.AndroidConfig_Impl
with the new gradle-experimental plugin, your configuration would be:
Note that version 0.3.0-alpha7 of the gradle-experimental plugin is out.
In addition to the previous response: With Experimental Plugin version 0.7.0-alpha1 this works on Windows
Add this to your build.gradle file. This will cause the
ndk-build
to run as part of project build using the specified .mk file.