0

I am trying to integrate firebase into my android app, but I am receiving this error:

Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrs.class

This is my app level 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'

I do not even see a zzrs.class file

Thanks

  • Do not use jars. Remove `fileTree`. Clean and try again. – Jared Burrows Nov 03 '16 at 03:17
  • @JaredBurrows I have removed the line: "compile fileTree(dir: 'libs', include: ['*.jar'])" but am receiving the same error – thearmanhammer Nov 03 '16 at 03:20
  • you should take a look at this answer. See the "EDIT" part of the answer, perform that task and see how to exclude what you see twice. http://stackoverflow.com/questions/39957924/java-util-zip-zipexception-duplicate-entry?answertab=active#tab-top – ᴛʜᴇᴘᴀᴛᴇʟ Nov 03 '16 at 03:35
  • `instabug` maybe bringing in the the same libs as `firebase`. Show `gradlew dependencies` here. – Jared Burrows Nov 03 '16 at 03:41
  • @JaredBurrows 'classpath 'com.android.tools.build:gradle:1.5.0' classpath 'com.google.gms:google-services:3.0.0'' – thearmanhammer Nov 03 '16 at 03:46
  • 2
    Possible duplicate of [How to resolve java.util.zip.ZipException?](http://stackoverflow.com/questions/26718825/how-to-resolve-java-util-zip-zipexception) – Learning Always Nov 03 '16 at 03:56

1 Answers1

0

try this:

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'

exclude group: 'com.google.android.gms'
}
Terry.Lee
  • 69
  • 6