0

I'm having a hard time trying to build a signed apk of my app, but I have an error related with google/android/gms class. Do you have idea of what the problem could be?

One more thing, I get this error only when I try to generate the signed apk, but in develop mode it runs fine in my smartphone. (I want to generate my app so anyone can install it on their phone)

I googled it and I know is related to gms version, but I can't identify exactly where in the code is the incompatibility of dependencies.

This is the gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.test_app.myfinalapp"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

android {
    useLibrary 'org.apache.http.legacy'
}

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.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.firebaseui:firebase-ui:2.0.1'
    compile 'com.firebaseui:firebase-ui-auth:2.0.1'
    compile 'me.dm7.barcodescanner:zxing:1.8.4'
    compile 'com.loopj.android:android-async-http:1.4.9'
    testCompile 'junit:junit:4.12'
}


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

And this is the error:

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzaso.class
Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50
mary jerson
  • 51
  • 10
  • just remove `compile 'com.firebaseui:firebase-ui-auth:2.0.1'` because `com.firebaseui:firebase-ui:2.0.1` already have `compile 'com.firebaseui:firebase-ui-auth:2.0.1'` – Om Infowave Developers Nov 13 '17 at 05:08
  • Try latest version of ui lib something like com.firebaseui:firebase-ui-auth:3.1.0 – VVB Nov 13 '17 at 05:09

1 Answers1

0
  1. Remove

    compile 'com.google.firebase:firebase-auth:10.0.1'
    

    and

    compile 'com.firebaseui:firebase-ui:2.0.1'
    

    if you are only using firebase-ui-auth, if you are using other firebase-ui components as well, then remove

    compile 'com.firebaseui:firebase-ui-auth:2.0.1'
    
  2. Update firebase-ui dependency versions from 2.0.1 to 3.1.0
Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50