2

Error

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;

I get this error when i add these two dependencies together:

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

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

app build.gradle

apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.2"emphasized text
    defaultConfig {
        applicationId "com.techstrategies.icall"
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

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.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.firebaseui:firebase-ui:0.6.0'
    testCompile 'junit:junit:4.12'
}




apply plugin: 'com.google.gms.google-services'
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Syed Zulqarnain
  • 47
  • 1
  • 1
  • 11
  • have you checked this post? http://stackoverflow.com/questions/26633591/multidex-support-in-android-application-error – Pratik Popat Feb 15 '17 at 08:56

1 Answers1

3

Check the official doc.
You are using the wrong version.

FirebaseUI Version  ->  Firebase/Play Services Version

1.1.1 -->   10.0.0 or 10.0.1
1.0.1 -->   10.0.0 or 10.0.1
1.0.0 -->   9.8.0
0.6.2 -->   9.8.0
0.6.1  -->  9.6.1
0.6.0  -->  9.6.0

Since you are using

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

you have to use:

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

or

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

EDIT:
Also since you are adding the Firebase-UI Auth library you have to add this repository:

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

Check the doc and this issue.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • i am getting this error after using 1.0.1 Error:Failed to resolve: com.twitter.sdk.android:twitter:2.2.0 – Syed Zulqarnain Feb 15 '17 at 09:12
  • @SyedZulqarnain The 1.x.x of the auth library adds a pre-requisite. Check the updated answer and the linked doc/issue. – Gabriele Mariotti Feb 15 '17 at 09:27
  • Thank you it worked for me and i got the error **"Failed to resolve: com.twitter.sdk.android:twitter:2.2.0 "** resolved from [link](https://github.com/firebase/FirebaseUI-Android/issues/392) – Syed Zulqarnain Feb 15 '17 at 09:38
  • @GabrieleMariotti two days!! i'm struggling since two days try every answers but this one works perfect. thank you so much sir..:) – Rucha Bhatt Joshi Apr 14 '17 at 08:57
  • @SyedZulqarnain for twitter error don't use dependency like this compile 'com.firebaseui:firebase-ui:1.1.1' but use specific like compile 'com.firebaseui:firebase-ui-database:1.1.1' – Rucha Bhatt Joshi Apr 14 '17 at 09:03