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

10

在更新我的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
8个回答

5
如果您在build.gradle中同时使用了support-v4和support-v7(版本不同),则请在顶部添加以下行: configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } 此外,建议您也阅读此文:链接

4
在我的情况下,这个
compile 'com.google.android.gms:play-services:+'

在我的build.gradle文件中,方法数量超过了65k的限制。
我将其更改为:
compile 'com.google.android.gms:play-services-maps:6.5.87'

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

希望这有所帮助


3

今天我突然遇到了这个错误,之后我尝试更新所有可以更新的东西,并按照这里建议更改了我的Gradle构建,但都没有奏效。

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


2

仅重新构建项目即可解决问题(Build->Rebuild Project)。您也可以清除项目。


1
我添加了以下内容来修复这个问题: compile ('com.facebook.android:facebook-android-sdk:3.22.0@aar'){ exclude module: 'support-v4' }

1

做这个会真的有帮助!在gradle模块中写入以下代码configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }不要删除html标签。希望能帮到你!


0

删除Google Analytics V2对我有帮助


-1

试试这个:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接