0

I am building an application with firebase but getting the app:transformClassesWithJarMergingForDebug error. I have checked all dependencies, but I'm not able to figure out the problem. I ma using firebase UI Authentication. Every time when i compile my app i get this error Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/iid/zzb.class The image also contains the full description.enter image description here

build.gradle(Project:Userlogin)

        // Top-level build file where you can add configuration options common to all sub-projects/modules.

        buildscript {
            repositories {
                jcenter()

            }
            dependencies {
                classpath 'com.android.tools.build:gradle:2.3.3'

                // NOTE: Do not place your application dependencies here; they belong
                // in the individual module build.gradle files
                classpath 'com.google.gms:google-services:3.0.0'
            }
        }

        allprojects {
            repositories {
                jcenter()
                maven { url 'https://maven.fabric.io/public' }
            }
        }

        task clean(type: Delete) {
            delete rootProject.buildDir
        }

    build.gradle(Module:app)
    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 26
        buildToolsVersion "26.0.2"
        defaultConfig {
            applicationId "com.example.anonymous.userlogin"
            minSdkVersion 16
            targetSdkVersion 26
            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'
            }
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        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:26.+'
        //android authentication dependicies.
        //android login with fb tw ph user nterface dependices
        //compile 'com.firebaseui:firebase-ui-auth:0.6.0'
        //facebook dependicies
        //compile 'com.facebook.android:facebook-login:4.27.0'
        //twitter dependicies
        compile('com.twitter.sdk.android:twitter-core:3.0.0@aar') { transitive = true }
        compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.google.firebase:firebase-auth:10.0.1'
        compile 'com.firebaseui:firebase-ui-auth:2.0.1'
        compile 'com.facebook.android:facebook-android-sdk:4.25.0'
        compile 'com.android.support:design:26.0.0-alpha1'
        compile 'com.google.firebase:firebase-database:10.0.1'
        testCompile 'junit:junit:4.12'
    }


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


    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion '26.0.0-alpha1'
                }
            }
        }
    }
Umair
  • 585
  • 3
  • 9
  • 21

1 Answers1

2

Your version of your Firebase SDKs does not match the version of your firebase-ui-auth SDK. There is a table that describes the proper versioning requirements in the documentation. SDK version 10.0.1 does not match up to firebase-ui version 2.0.1 as you have it now. SDK version 10.0.1 matches with firebase-ui 1.1.1.

By the way, your Firebase dependencies are very old. Consider upgrading them.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • but when I upgrade the dependencies it shows me errors and compel me to move back then how should I upgrade these dependencies. can you kindly help me in this because I also want to upgrade all firebase dependencies. – Umair Jan 18 '18 at 10:40