0

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/internal/zzni;

Burhan Khanzada
  • 945
  • 9
  • 27

2 Answers2

1

You need to enable multidex add these lines in app level build.gradle

android {
compileSdkVersion 23
buildToolsVersion '23.0.0'

defaultConfig {
    applicationId "com.wowio.ebookreader"
    minSdkVersion 14
    targetSdkVersion 21
    multiDexEnabled true

}


dexOptions {
    javaMaxHeapSize "4g"
}
} 

and add this dependency

 dependencies {

compile 'com.android.support:multidex:1.0.1'

 }
Manohar
  • 22,116
  • 9
  • 108
  • 144
0

If Build > Clean Project doesn't work, you are probably adding Google Play Service from multiple places, or probably one of your dependencies is.

You can try adding the following in your build.gradle within android {}:

packagingOptions {
    pickFirst 'com/google/android/gms/*'
    pickFirst 'com/google/android/gms/**/*'
}

It will pick the first classes that it comes accross.

Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55