android - 出现错误 --> "Execution failed for task">NDK 未配置

标签 android android-studio

我正在尝试在 android studio 上编译我的代码,但我被困在了这一点上。我没有任何东西可以使用 ndk 进行编译,但每次编译都会因此错误而失败。

当我检查 workspace.xml 时,它包含用于 compileDebugNdk 和 compileReleaseNdk 的 ExternalTask​​Pojo。

我不需要它们,但无法找到删除它们的方法,因为它是一个自动生成的文件。

请提出建议。

编辑->build.gradle文件

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文件

   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。

sourceSets.main {
        jniLibs.srcDir 'src/main/libs'
        jni.srcDirs = [] //disable automatic ndk-build call
    }

关于android - 出现错误 --> "Execution failed for task">NDK 未配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26271394/

相关文章:

android-studio - 我在 Android Studio 的布局编辑器中找不到工具栏

android - 在 Android Studio Gradle 项目中运行 groovy shell

android - : java. lang.IllegalArgumentException 多个 fragment 引起

android - SMS 发送在 2.2 Froyo 中有效,但在 ICS 4.0 中无效

android - com.android.dex.DexIndexOverflowException : method ID not in [0, 0xffff]:android studio 中的 65536

android - 非法参数异常 : button doesn't exist 0 in android studio 2. 1 在 ubuntu 14.04

android - 当方向改变发生时调用哪个 Activity 方法?

java - Android 搜索 View 不调用搜索 Activity

Android Wear 仅适用于已签名的 .apk

java - Gradle Android Studio