Java.util.zip.ZipException:重复条目:com/google/common/base/FinalizableReference.class
为什么会出现这个错误,当我同步Gradle但是当我运行项目时,这个错误。Java.util.zip.ZipException:重复条目:com/google/common/base/FinalizableReference.class
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/base/FinalizableReference.class
我不知道哪个依赖的原因这个错误,我的依赖关系。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:percent:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.facebook.android:facebook-android-sdk:4.19.0'
compile 'com.google.android.gms:play-services-auth:11.0.0'
compile 'com.google.android.gms:play-services-location:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services-places:11.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3.4'
compile 'io.nlopez.smartlocation:library:3.3.1'
compile 'com.appeaser.sublimenavigationviewlibrary:sublimenavigationviewlibrary:0.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:[email protected]'
compile 'com.afollestad:sectioned-recyclerview:0.4.1'
compile 'com.github.medyo:fancybuttons:1.8.3'
compile 'com.basgeekball:awesome-validation:2.0'
compile 'com.github.michaelye.easydialog:easydialog:1.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
编辑
我想通了导致此问题的播放服务的依赖。当我使用的10.2.6
代替11.0.0
应用程序是可以正常使用的时候,我只是改变依赖判断
compile 'com.google.android.gms:play-services-auth:10.2.6'
compile 'com.google.android.gms:play-services-location:10.2.6'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.google.android.gms:play-services-places:10.2.6'
,但我想用最新版本的播放服务11.0.0
,但它给了我上述问题。如何解决这个问题?任何帮助将appriciated谢谢。
最后问题解决了。似乎它的一个错误谷歌解决了这个问题的更新版本。
使用Play服务版本11.0.1
...
在项目层面gradle这个使用
classpath 'com.google.gms:google-services:3.1.0'
有时候,这个问题是因为包括不同版本的播放服务(或其他库)的。看看应用程序依赖使用如下:
gradle这个应用程序:依赖
,或者如果您使用的包装器的摇篮
./gradlew应用:依赖
可能有一些其他使用较旧版本库的第三方库。如果是这样,请从第三方库中排除较旧的库并包含最新的库。
你可以做这样的事情:
compile ('com.thirdpartylib.android:library-sdk:8.3.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:support-annotations:26.0.0'
compile 'com.google.android.gms:play-services-gcm:11.2.0'
}
这应该解决任何重复的项目,主要的原因问题
nope bro它是'11.0.0'中的问题,在更高版本中已修复 –
使用'编译“com.google.maps.android:android-maps- utils:0.5 +' –
@IntelliJAmiya还是一样的错误 –
我觉得它的一个bug。你可以通过删除这一行'apply plugin:'com.google.gms.google-services''来提高 –