在我在我的项目中更新了firebase之后,这个错误开始出现。如果我试着建造这个项目,它的工作正常。但是,每当试图构建一个签名的APK时,它就会产生以下错误。
错误:任务':app:transformClassesWithJarMergingForProductionRelease'.执行失败 com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目: com/google/android/gms/measurement/AppMeasurementContentProvider.class
下面是我的项目依赖项。不确定重复发生在哪里。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile(name: 'google-maps-sdk-m4b', ext: 'aar')
compile('io.intercom.android:intercom-sdk:1.+@aar') { transitive = true }
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.mixpanel.android:mixpanel-android:4.6.4'
compile 'com.google.maps.android:android-maps-utils:0.4.1'
compile 'com.stripe:stripe-android:+'
compile 'com.github.jkwiecien:EasyImage:1.2.1'
compile 'com.github.dbachelder:CreditCardEntry:1.4.7'
compile 'com.appsflyer:af-android-sdk:4.3.5@aar'
compile 'com.bugsnag:bugsnag-android:+'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.0'
}
apply plugin: 'com.google.gms.google-services'发布于 2016-08-04 11:06:17
所以我想出了解决问题的办法。添加exclude group: 'com.google.android.gms'解决了这个问题:
compile('io.intercom.android:intercom-sdk:1.+@aar') {
transitive = true
exclude group: 'com.google.android.gms'
}发布于 2016-11-22 20:08:33
我通过改变
classpath 'com.google.gms:google-services:2.0.0-alpha2'至
classpath 'com.google.gms:google-services:3.0.0'在项目级分级文件中
https://stackoverflow.com/questions/38616875
复制相似问题