当前位置: 首页 > 知识库问答 >
问题:

多个dex文件,完成时退出值为非零2

冯风史
2023-03-14
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
    Error:Execution failed for task ':XXXX:dexDebug'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_76\bin\java.exe'' finished with non-zero exit value 2
    Information:BUILD FAILED
    Information:Total time: 20.04 secs
    Information:1 error

Information:0 warnings
Information:See complete output in console
dependencies {
    //compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':appcompat_v7')
    compile 'com.braintreepayments.api:braintree:1.+'
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.loopj.android:android-async-http:1.4.5'
    compile 'com.google.android.gms:play-services-wallet:7.5.0'
}

共有1个答案

沈翰
2023-03-14

项目中有多个支持库。您可以尝试以下步骤:

>

  • 在windows资源管理器(windows)/查找器(Mac)中打开项目文件夹。检查项目的libs文件夹和任何支持库(如appcompact_v7)的libs文件夹。

    检查是否有多个同名的JAR文件。

  •  类似资料: