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引入第三方包报错:The number of method references in a .dex file cannot exceed 64K.

 

这样基本可以了

 

 

Flutter的忽略

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

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

相关文章:

  • 2021-06-01
  • 2022-12-23
  • 2021-09-04
  • 2021-06-22
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2021-05-23
  • 2021-06-12
  • 2021-08-26
  • 2022-01-13
  • 2021-11-02
  • 2022-01-29
  • 2022-12-23
相关资源
相似解决方案