0

I try to build APK in Android Studio, but it shows error message is

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

I can build apk successfully in other app , so i don't know why the message.

Has anyone can teach me how to solve this issue ?

enter image description here

Morton
  • 5,380
  • 18
  • 63
  • 118

2 Answers2

2

You need to enable multiDex in gradle:

    android {
    defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 25
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

To know more about the cause of this issue, read this Configure Apps with Over 64K Methods

OBX
  • 6,044
  • 7
  • 33
  • 77
1

Just add these lines in the build.gradle:

android {
defaultConfig {
    multiDexEnabled true
}
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

and in your manifest,

<application
    <meta-data android:name="android.support.multidex.MultiDexApplication">
</application>
Mayura Devani
  • 440
  • 3
  • 17