Gradle java.util.zip.ZipException:重复条目:com/google/common/annotations/Beta.class

Gradle java.util.zip.ZipException:重复条目:com/google/common/annotations/Beta.class,gradle,android-gradle-plugin,build.gradle,Gradle,Android Gradle Plugin,Build.gradle,运行项目时发生此错误,无法运行生成的应用程序 我已经清理了构建和重建项目再次导致相同的问题 * What went wrong: Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google

运行项目时发生此错误,无法运行生成的应用程序

我已经清理了构建和重建项目再次导致相同的问题

* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class
我在下面分享了我的gradle文件。请帮助我找到要在gradle文件中进行的更改以运行我的应用程序

渐变文件

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.0@aar') {
        transitive = true;
    }

    compile 'com.uber.sdk:rides-android:0.5.3'
    compile 'com.twitter.sdk.android:twitter:3.1.1'

    compile project(':branchsdk')
    compile project(':squarecamera')

    compile 'com.google.code.gson:gson:2.5'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile 'com.facebook.rebound:rebound:0.3.8'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
    compile 'se.emilsjolander.stickylistheaders:library:2.1.0'
    compile ('com.android.support:support-v4:26.0.0')
            {   exclude group: 'org.apache.httpcomponents', module: 'httpclient'
                exclude module: 'support-annotations'
            }
    compile ('com.android.support:appcompat-v7:26.0.0'){
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
        exclude group: 'com.android.support'
    }

    compile 'com.github.siyamed:android-shape-imageview:0.9.2'
    compile 'com.adobe.creativesdk.foundation:auth:0.5.3'
    compile 'com.adobe.creativesdk.foundation:assets:0.5.3'
    compile 'com.adobe.creativesdk:image:4.0.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'

    compile ('com.google.android.gms:play-services:11.6.2'){
        exclude group: 'com.google.guava'
    }

    compile 'com.parse:parse-android:1.10.2'
    compile 'org.altbeacon:android-beacon-library:2.5.1'
    compile 'org.apache.commons:commons-collections4:4.0'

    compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar'
    compile 'de.greenrobot:eventbus:2.4.0'

    compile ('com.android.support:recyclerview-v7:26.0.0')
            {
                exclude group: 'com.android.support'
            }
    compile ('com.android.support:multidex:1.0.1')
            {
                exclude group: 'com.android.support'
            }

    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }

    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'com.google.firebase:firebase-config:11.6.2'
    compile 'com.google.firebase:firebase-messaging:11.6.2'

    compile project(':ucrop')
    compile project(':library')

    compile 'com.facebook.android:facebook-android-sdk:[4,5)'

    compile 'com.google.guava:guava:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
请帮我解决这个问题


提前感谢…

我想你被谷歌收藏更名为番石榴(guava)所刺痛了,你的类路径上可能有这两个

例如:

或者另一个问题可能是这个

fileTree(include: ['*.jar'], dir: 'libs')
这个libs文件夹中的jar不能参与依赖项解析,因为没有元数据(例如group/artifact/version),所以这里也可能有重复项

请参见在maven目录布局中存储本地JAR

fileTree(include: ['*.jar'], dir: 'libs')