【问题标题】:Execution failed for task ':app:dexDebug' Android Studio任务 ':app:dexDebug' Android Studio 执行失败
【发布时间】:2015-05-23 09:15:33
【问题描述】:
该应用程序能够在更新我的 android studio 之前执行,这是我得到的错误:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:
Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished
with non-zero exit value 1
【问题讨论】:
标签:
java
android
android-studio
build.gradle
【解决方案1】:
如果您在 build.gradle 中有 support-v4 和 support-v7(不同版本),则将此行添加到您的 build.gradle 顶部。
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
Also read this
【解决方案2】:
就我而言,
compile 'com.google.android.gms:play-services:+'
在我的 build.gradle 中超过了 65k 方法限制。
我改成
compile 'com.google.android.gms:play-services-maps:6.5.87'
修复它(我的应用程序中只需要地图)
希望对你有帮助
【解决方案3】:
我今天无中生有地遇到了这个错误,之后我尝试更新所有可用的东西,尝试按照here 的建议更改我的 gradle 构建,但都没有奏效。
经过数小时的绝望和 AS 更新,一个简单的“干净项目”和“重建项目”对我有用。
【解决方案4】:
只需重建项目即可解决问题(Build->Rebuild Project)。你也可以清理项目
【解决方案5】:
我修正了添加:
compile ('com.facebook.android:facebook-android-sdk:3.22.0@aar'){
exclude module: 'support-v4'
}
【解决方案6】:
这样做真的对我有帮助!
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
} 在 gradle 模块中写这个。希望对您有所帮助!
【解决方案8】:
试试这个:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}