0

I'm using android studio and there are no problems when running the app only when building its apk.

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.DexIndexOverflowException: method ID not in [0, 0xffff]:  
65536
Cœur
  • 37,241
  • 25
  • 195
  • 267
Boneyflesh
  • 65
  • 7

3 Answers3

1

Add the following line:

multiDexEnabled true

Inside the defaultConfig of build.gradle

defaultConfig
{
    multiDexEnabled true
}
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
1

That helped me: in your build.gradle add the following:

android {
...
defaultConfig {
    minSdkVersion 16
    targetSdkVersion 24
    multiDexEnabled true
    }
}
Android Geek
  • 8,956
  • 2
  • 21
  • 35
0

Also add following in android of build.gradle along with multidexEnabled

dexOptions {
  javaMaxHeapSize "4g"
}
Foram Shah
  • 191
  • 6