获取错误 -->“任务执行失败">未配置NDK
我正在尝试在 android studio 上编译我的代码,但此时我卡住了.我没有任何东西可以使用 ndk 进行编译,但每次编译失败时都会出现此错误.
I am trying to compile my code on android studio and I am stuck at this point. I don't have any thing to compile using the ndk but everytime the compilation fails with this error.
当我检查 workspace.xml 时,它包含用于 compileDebugNdk 和 compileReleaseNdk 的 ExternalTaskPojo.
When I check the workspace.xml it contains ExternalTaskPojo for compileDebugNdk and compileReleaseNdk.
我不需要它们,但无法找到删除它们的方法,因为它是自动生成的文件.
I don't need them but can't figure out a way to remove them as it is an auto generated file.
请提出建议.
编辑 -> build.gradle 文件
Edit -> build.gradle file
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':e')
compile 'com.android.support:support-v4:19.1.0'
}
另一个 build.gradle 文件
Another build.gradle file
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
}
}
dependencies {
compile project(':a')
compile project(':facebookSDK')
compile project(':b')
compile project(':c')
compile project(':d')
compile project(':volley')
compile project(':e')
compile project(':volley')
compile project(':f')
compile project(':g')
compile project(':h')
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/AF-Android-SDK-v1.3.16.0.jar')
compile files('libs/lib1')
compile files('libs/lib2')
compile files('libs/lib3')
compile files('libs/lib4')
compile files('libs/FlurryAgent.jar')
compile files('libs/renderscript-v8.jar')
compile files('libs/lib5')
}
一段时间后,我解决了我的问题.我通过在 build.gradle 文件中添加以下属性禁用了 ndk-build.
After sometime I was able to fix my problem. I disabled the ndk-build by adding below property in the build.gradle file.
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build call
}