打包時(shí)遇到這個(gè)問(wèn)題馍佑,查找了很多解決方案都未能解決酒甸。最終找到了一個(gè)方案結(jié)束了我漫長(zhǎng)的英文閱讀之路堆巧。這里分享一下。
在 build.gradle 中進(jìn)行如下配置牍颈。
dexOptions {
incremental true
javaMaxHeapSize "4g"
keepRuntimeAnnotatedClasses false
}
出處:https://stackoverflow.com/questions/32721083/too-many-classes-in-main-dex-list-main-dex-capacity-exceeded
另外言疗,方法數(shù)超過(guò) 64k 可以參考官方提供的解決方案:
https://developer.android.com/studio/build/multidex.html