错误:任务':app:dexDebug'的执行失败。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException

时间:2015-07-12 10:59:43

标签: java android

我在运行项目时收到此错误。

Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

任何人都可以建议我如何纠正它吗?

这是我的build.gradle文件:

apply plugin: 'com.android.application'




android {




 compileSdkVersion 22

  buildToolsVersion "23.0.0 rc2"


    defaultConfig {
        applicationId "com.example.shreyatakkar.student"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:22.2.0'

}

1 个答案:

答案 0 :(得分:1)

我在更新到最新的Android Studio后也遇到此错误。我通过在multiDexEnabled true build.gradle内添加defaultConfig来解决此问题。

示例:

defaultConfig {
    applicationId "com.example.shreyatakkar.student"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}