Duplicate files copied in APK

遇到这个错误几次了,一直解决不了,很头痛;

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.google.auto/auto-common/pom.xml
    File1: C:\Users\admin\.gradle\caches\modules-2\files-2.1\com.google.dagger\dagger-compiler\2.0.2\1170f75c1ce293f80755bbc9fcd60e0765022bd0\dagger-compiler-2.0.2.jar
    File2: C:\Users\admin\.gradle\caches\modules-2\files-2.1\com.google.auto\auto-common\0.6\cf7212b0f8bfef12657b942df8f4f2cf032d3f41\auto-common-0.6.jar

有好多方法 ;如下
packagingOptions {
exclude ‘META-INF/DEPENDENCIES.txt’
exclude ‘META-INF/LICENSE.txt’
exclude ‘META-INF/NOTICE.txt’
exclude ‘META-INF/NOTICE’
exclude ‘META-INF/LICENSE’
exclude ‘META-INF/DEPENDENCIES’
exclude ‘META-INF/notice.txt’
exclude ‘META-INF/license.txt’
exclude ‘META-INF/dependencies.txt’
exclude ‘META-INF/LGPL2.1’
}
都解决不了 ,最后我得出的结果 是
dagger2 和butterknife 互斥,解决办法也找了 最终没有解决;
贴出来我的build.gradle

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    //realm
    compile 'io.realm:android-adapters:1.3.0'
    //support v7
    compile 'com.android.support:appcompat-v7:24+'
    compile 'io.reactivex:rxandroid:1.1.0'
    compile 'io.reactivex:rxjava:1.1.0'
    //dagger
    compile 'com.google.dagger:dagger:2.6'
    apt 'com.google.dagger:dagger-compiler:2.6'
    compile 'org.glassfish.main:javax.annotation:4.0-b33'
    //recyclerview
    compile 'com.android.support:cardview-v7:24+'
    compile 'com.android.support:recyclerview-v7:24+'
    //butterknife
//    compile 'com.jakewharton:butterknife:8.2.1'
//    compile 'com.jakewharton:butterknife-compiler:8.2.1'

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值