java.util.zip.ZipException:重复的条目错误

时间:2017-07-09 13:07:21

标签: java android

这是我的build.gradle依赖项部分:  `

依赖项{

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

compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/google-play-services.jar')

compile files('libs/android-async-http-1.4.9.jar')
compile 'cz.msebera.android:httpclient:4.3.6'
compile 'com.google.android.gms:play-services-location:7.+'

我的错误是: 错误:任务':app:packageAllDebugClassesForMultiDex'执行失败。

  

java.util.zip.ZipException:重复条目:com / google / android / gms / auth / UserRecoverableAuthException.class

导致错误的原因是什么?

2 个答案:

答案 0 :(得分:0)

您在gradle文件中添加了两次google-play-services。

compile files('libs/google-play-services.jar') 
compile 'com.google.android.gms:play-services-location:7.+' 

build.gradle文件中删除以下行。

compile files('libs/google-play-services.jar')

答案 1 :(得分:0)

您需要在项目link

中使用multidex