0

After updating android studio and several dependencies i now get this error message

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzeg.class

this is my gradle file apply plugin: 'com.android.application'

apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'com.google.firebase.firebase-perf'



android {
    compileSdkVersion 26
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "REMOVED_FOR_PRIVACY"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates

        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // compile 'com.firebaseui:firebase-ui:1.2.0'

    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }






    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:mediarouter-v7:26.0.2'
    compile 'com.google.android.gms:play-services-location:11.2.0'
    compile 'com.google.firebase:firebase-core:11.2.0'
    compile 'com.google.firebase:firebase-crash:11.2.0'
    compile 'com.google.firebase:firebase-auth:11.2.0'
    compile 'com.google.firebase:firebase-messaging:11.2.0'
    compile 'com.google.firebase:firebase-database:11.2.0'
    compile 'com.google.firebase:firebase-perf:11.2.0'
    compile 'com.firebaseui:firebase-ui-auth:2.0.1'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.android.support:design:26.0.2'
    compile 'com.github.bumptech.glide:glide:4.0.0'
    compile 'com.android.support:support-v4:26.0.2'
    compile 'com.android.support:multidex:1.0.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
    testCompile 'junit:junit:4.12'
}



apply plugin: 'com.google.gms.google-services'

I already tried Cleaning and Rebuilding the project but nothing seems to work

2 Answers2

0

Bump up your build tool version to:

buildToolsVersion "26.0.2"

And exclude Play Services from Facebook, for example

compile ('com.facebook.android:facebook-android-sdk:[4,5)'){
    exclude group:"com.google.android.gms"
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
akshay_shahane
  • 4,423
  • 2
  • 17
  • 30
0

okay what seemed to actually work was replacing

'com.google.android.gms:play-services-location:11.2.0'

with

'com.google.android.gms:play-services:11.2.0'
  • That's compiling too many libraries if all you want is the location package – OneCricketeer Sep 03 '17 at 19:13
  • For reference. https://stackoverflow.com/questions/39008887/how-do-i-show-dependencies-tree-in-android-studio/39020703#39020703 – OneCricketeer Sep 03 '17 at 19:15
  • i Know but that is the only solution that is working right now. so I'll go with it until i figure this out. also when i use the location library i get a warning about conflict with a previous version of the library. I think i have to delete the old one so I'll try that – Mohammed El_Sayed Sep 03 '17 at 19:21
  • 1
    I think one of the other libraries is depending on an old version of the play services. You can use that link to find which one, then exclude it, as the other answer says – OneCricketeer Sep 03 '17 at 19:22