0

Need help.

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/inte

The application runs on api level 23 but gives the above error for api 16 which is my minsdk.

my gradle file :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
    applicationId "com.example.raghavkishan.financialplanner"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
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.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

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

Thanks.

  • 1
    Possible duplicate of [Multiple dex files define Lcom/google/android/gms/internal/zzau](http://stackoverflow.com/questions/31224276/multiple-dex-files-define-lcom-google-android-gms-internal-zzau) – fweigl Apr 28 '17 at 23:26
  • I tried the solutions mentioned there but it did not work. – Raghav Kishan Apr 29 '17 at 07:08
  • @RaghavKishan what was the error now when you followed? Please always provide full error responses. – Sufian Apr 30 '17 at 19:01
  • @Sufian The error is the same as mentioned above. I am using only one google play services dependency and it is the Auth dependency. – Raghav Kishan May 02 '17 at 19:49

1 Answers1

0

First clean project and rebuild,then add following code in your project's app level build.gradle file: defaultConfig { multiDexEnabled true }

In your build.gradle file, dependencies contains following lines:

compile 'com.google.firebase:firebase-auth:10.2.1' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.android.gms:play-services-auth:10.2.1'

Instead this change to following lines:

compile 'com.google.firebase:firebase-auth:10.2.1' compile 'com.google.firebase:firebase-database:10.2.1' compile 'com.google.android.gms:play-services-auth:10.2.1'

just make sure each version have same values.

Omkar
  • 3,040
  • 1
  • 22
  • 42
  • The error I got is: "Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzblr.class " – Raghav Kishan May 02 '17 at 20:08