Dex分包只对Host生效,对Bundle不生效。也就是在Bundle内不能做Dex分包处理,若方法数超过65536,只能拆分Bundle。
android {
defaultConfig {
multiDexEnabled true
}
}
atlas {
atlasEnabled true
tBuildConfig {
atlasMultiDex true
}
}
如没有配置multiDexEnabled true,则报错:
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: field ID not in [0, 0xffff]: 65536




