Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZipException: duplicate entry: com/google/android/gms/internal/measurement/zzabn.class

Tags:

android

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/measurement/zzabn.class

  • This error shown while generating signed apk.

    here is my build.gradle

    apply plugin: 'com.android.application'
    
    android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    
    defaultConfig {
        applicationId "com.jhaider.livefootballmatchesofworldcup"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    
    packagingOptions {
        exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties'
        exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
        exclude 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml'
        exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
    
    
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/maven/pom.properties'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/gson/FieldAttributes.class'
        exclude '.readme'
    
    
    }
    
    dexOptions {
        javaMaxHeapSize "4g"
    }
    
    buildTypes {
        release {
            minifyEnabled false
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    
    flavorDimensions "app-type"
    productFlavors {
        live1016 {
            applicationId "com.jhaider.livefootballmatchesofworldcup"
            minSdkVersion 16
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            dimension "app-type"
        }
    
        videohighlights {
            applicationId "com.jhaider.livefootballmatchesofworldcup.videohighlights"
            minSdkVersion 16
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            dimension "app-type"
        }
    }
    

    sourceSets { live1016 { java { srcDir 'src/live1016/java' } resources { srcDir 'src/live1016/res' } }

        videohighlights {
            java {
                srcDir 'src/videohighlights/java'
            }
            resources {
                srcDir 'src/videohighlights/res'
            }
        }
    
    }
    

    }

    dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.google.firebase:firebase-invites:15.0.0'   
    compile 'com.google.firebase:firebase-messaging:15.0.0'
    compile 'com.google.firebase:firebase-ads:15.0.0'
    compile 'com.google.firebase:firebase-auth:15.0.0'
    
    compile 'com.google.firebase:firebase-core:15.0.0'
    

    compile 'com.firebaseui:firebase-ui-auth:3.2.2'

    compile ('com.google.android.gms:play-services-auth:15.0.0'){
    
        force=true
    }
    compile ('com.google.android.gms:play-services-location:15.0.0'){
    
        force=true
    }
    compile project(':StartAppInApp-3.6.7')
    
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.okhttp3:okhttp:3.3.0'
    compile 'org.jsoup:jsoup:1.9.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    

    }

    // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'

like image 724
Nauman Afsar Avatar asked Dec 14 '22 16:12

Nauman Afsar


1 Answers

I solved by upgrading all the firebase dependencies on build.gradle from 15.0.0 to 15.0.2 where available.

Go to https://firebase.google.com/docs/android/setup for latest versions available and note that latest version for com.google.firebase:firebase-ads is 15.0.0 and latest version for com.google.firebase:firebase-messaging is 15.0.2

like image 151
Dario Ceccoli Avatar answered May 31 '23 22:05

Dario Ceccoli