出现错误-> “执行任务失败". >未配置NDK [英] Getting error --> "Execution failed for task" >NDK not configured

查看:87
本文介绍了出现错误-> “执行任务失败". >未配置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的ExternalTask​​Pojo.

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
    }

这篇关于出现错误-> “执行任务失败". >未配置NDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆