【发布时间】:2016-11-03 03:14:39
【问题描述】:
我正在尝试将 firebase 集成到我的 android 应用程序中,但收到此错误:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrs.class
这是我的应用级 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.evan.scout"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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.instabug.library:instabug:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-config:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
我什至没有看到 zzrs.class 文件
谢谢
【问题讨论】:
-
不要使用罐子。删除
fileTree。清理并重试。 -
@JaredBurrows 我删除了以下行:“compile fileTree(dir: 'libs', include: ['*.jar'])”但收到同样的错误
-
你应该看看这个答案。请参阅答案的“编辑”部分,执行该任务并查看如何排除您两次看到的内容。 stackoverflow.com/questions/39957924/…
-
instabug可能会引入与firebase相同的库。在此处显示gradlew dependencies。
标签: android firebase duplicates android-multidex