flutter踩坑小记:The number of method references in a .dex file cannot exceed 64K.

The number of method references in a .dex file cannot exceed 64K.

这句话的意思翻译出来是:.dex文件中的方法引用数不能超过64K。

我的理解: 引用的第三方的方法超过了64K,需要在Android包下配置multidex减少第三方包引入(个人理解)

解决方案:

在android/app/build.gradle中的 dependencies 下添加 

implementation 'com.android.support:multidex:1.0.3'
 
在android/app/build.gradle中的 defaultConfig 下添加 
multiDexEnabled true
 
 

此方案不能保证一定解决问题,但可以试试。

猜你喜欢

转载自www.cnblogs.com/wyhlightstar/p/11122468.html
今日推荐