标题说明了一切,我正在尝试将 firebase-ads 集成到我的应用程序中,这带来了很多问题,其中一些我设法解决了。我现在面临的问题是一个看起来像这样的错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqq$zza.class
此错误仅在添加 Firebase 时发生。
我已经在互联网上搜索了很长一段时间,但到目前为止我发现的所有内容似乎都没有帮助。
我的 模块:app
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "myID"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:4.8.0'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.amirarcane.recent-images:recentimages:1.0.0'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.4.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.github.chrisbanes:PhotoView:1.3.0'
compile "com.daimajia.swipelayout:library:1.2.0@aar"
compile "com.andkulikov:transitionseverywhere:1.7.0"
compile 'com.google.firebase:firebase-ads:9.2.1'
}
apply plugin: 'com.google.gms.google-services'
先感谢您!
最佳答案
经过 4 个多小时的尝试,几乎完成了重新安装 Android Studio 的所有工作,我终于设法让它工作了。对于所有遇到同样问题的人,我希望这个解决方案可以帮助您并为您节省大量时间,我很遗憾失去了这些时间。
只需删除 :apply plugin:'com.google.gms.google-services'
尽管这不是解决方案,而是一种解决方法,但这是迄今为止唯一对我有用的方法。如果您确实选择使用此“解决方法”,请不要忘记在将来遇到另一个问题时已将其删除。
关于android - "ZipException: duplicate entry"集成 Firebase 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40706648/