多个dex文件定义了Landroid / support / annotation / AnimRes Error.How如何找到重复的引用?

时间:2015-08-10 07:24:50

标签: android android-studio

  • 错误
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 ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

我找到相关答案Here,但Android Studio Android支持 - 如何在v4包中找到重复?

  • 我的build.gradle文件
repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'com.orhanobut:logger:1.11'
    compile 'com.koushikdutta.ion:ion:2.1.6'
    compile(name: 'MiotService-release', ext: 'aar')
    compile(name: 'plug_common-release', ext: 'aar')
    //AndroidViewAnimations
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
}
  • 我的libs文件夹
ite-orm-1.5.jar
litecommon1.0.0.jar
MiotService-release.aar
plug_common-release.aar
qiniu-android-sdk-7.0.6.jar
zxing-core-3.2.0.jar

你有其他解决办法吗?请告诉我。

1 个答案:

答案 0 :(得分:1)

build.gradle andoid{ }内的defaultConfig { multiDexEnabled true } 中试用此代码:

.filter