java 任务 ':app:dexDebug' Android Studio 执行失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29158456/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 14:46:25  来源:igfitidea点击:

Execution failed for task ':app:dexDebug' Android Studio

javaandroidandroid-studiobuild.gradle

提问by Rim Gazzah

The application was able to execute before updating my android studio,this is the error I am getting:

该应用程序能够在更新我的 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

回答by noman404

If you have support-v4 and support-v7 (with different version) in build.gradle then add this line into your build.gradle at top.

如果您在 build.gradle 中有 support-v4 和 support-v7(具有不同版本),则将此行添加到您的 build.gradle 顶部。

configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }

configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }

Also read this

也读这个

回答by Lukas Lechner

in my case, the

就我而言,

compile 'com.google.android.gms:play-services:+'

in my build.gradle exceeded the 65k method limit.

在我的 build.gradle 中超过了 65k 方法限制。

i changed it to

我把它改成

compile 'com.google.android.gms:play-services-maps:6.5.87'

to fix it (i only need maps in my application)

修复它(我只需要在我的应用程序中使用地图)

hope that helps

希望有帮助

回答by Thiago Queiroz

I got this error today out of nothing, after that i tried to update every single thing available, tried to change my gradle build as suggested herebut none of it worked.

我今天无缘无故地得到了这个错误,之后我尝试更新所有可用的东西,尝试按照此处的建议更改我的 gradle 构建, 但没有一个奏效。

After hours of dispair and AS updates, a simple "clean project" and "rebuild project" worked for me.

经过数小时的失望和 AS 更新,一个简单的“清理项目”和“重建项目”对我有用。

回答by Misha Akopov

Just rebuilding project fixes the issue (Build->Rebuild Project). You can also clean project

只需重建项目即可解决问题(Build-> Rebuild Project)。您还可以清理项目

回答by Madi

Do this it really help me! configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }write this inside gradle module. Hope it help!

这样做真的对我有帮助! configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }在 gradle 模块中写这个。希望有帮助!

回答by Ultimo_m

I fixed that adding:

我修复了添加:

compile ('com.facebook.android:facebook-android-sdk:3.22.0@aar'){ exclude module: 'support-v4' }

compile ('com.facebook.android:facebook-android-sdk:3.22.0@aar'){ exclude module: 'support-v4' }

回答by Elnatan Derech

Remove google analytics V2 helps for me

删除谷歌分析 V2 对我有帮助

回答by Ahmad ELkhwaga

Try this :

试试这个 :

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
}