Error:Execution failed for task ':ttt: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
解决办法:谷歌官方推荐使用MultiDexApplication
Gradle 配置:
defaultConfig {
applicationId "XXX"
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Application 类重写方法:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}