安卓如何修复java。util。拉链ZipException:重复条目:com/google/firebase/FirebaseApiNotAvailableException。班
我得到一个错误: 错误:任务“:app:transformClassesWithJarMergingForRelease”的执行失败
com.安卓.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/FirebaseApiNotAvailableException.class
代码为:
dependencies {
compile 'com.安卓.support:support-v4:24.0.0'
compile 'com.安卓.support:appcompat-v7:24.0.0'
compile 'com.安卓.support:mediarouter-v7:24.0.0'
compile(files('libs/play-hub-support.jar'))
compile('com.google.安卓.gms:play-services-cast:8.3.0') {
exclude group: 'com.google.安卓.gms'
}
compile('com.google.安卓.gms:play-services-analytics:8.3.0') {
exclude group: 'com.google.安卓.gms'
}
compile('com.google.安卓.gms:play-services-auth:9.0.2') {
exclude group: 'com.google.安卓.gms'
}
compile('com.google.安卓.gms:play-services-ads:11.2.0') {
exclude group: 'com.google.安卓.gms'
}
compile 'com.安卓.support:multidex:1.0.1'
compile 'com.larswerkman:HoloColorPicker:1.5'
}
# 1 楼答案
对所有播放服务使用相同的版本
# 2 楼答案
不要使用不同版本的Google Play服务和Firebase
使用最新版本但不排除它们本身(*):
(*)这个
exclude
没有意义。在依赖项中删除它