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
 
 

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

 

posted @ 2019-07-02 18:51  _whys  阅读(1989)  评论(0编辑  收藏  举报