我知道如何将自定义Android.mk
与旧 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
}
它不适用于新的 gradle: com.android.tools.build:gradle-experimental:0.2.0
:
Error:Cause: com.android.build.gradle.managed.AndroidConfig_Impl