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。

解决方法:

在android/app/build.gradle中添加

dependencies中添加
implementation 'com.android.support:multidex:1.0.3'
defaultConfig中添加
multiDexEnabled true

 

这样基本可以了

 

 

Flutter的忽略

原生安卓可能还需要写一个application,添加如下代码

@Override
     protected void attachBaseContext(Context base) {
         super.attachBaseContext(base);
        MultiDex.install(this) ;
     }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM