星空网 > 软件开发 > 操作系统

如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

一:问题描述:

如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64kimages/loading.gif' data-original="http://images2015.cnblogs.com/blog/605655/201604/605655-20160414130127676-1708797909.png" />

    应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了.

 

二、解决方案:

     方案1:使用插件化框架  比如: https://github.com/singwhatiwanna/dynamic-load-apk

    方案2:分割Dex

 

三:分割 Dex 文件实现方法 

     1、相关链接

     https://developer.android.com/tools/building/multidex.html#about

     2、在app的 build.gradle 中

         (1)在dependencies 中添加  

                compile 'com.android.support:multidex:1.0.0'

         (2)在 defaultConfig 中添加

                multiDexEnabled true

                     比如   

1  defaultConfig {2     applicationId "com.pegasus.map"3     minSdkVersion 154     targetSdkVersion 235     versionCode 16     versionName "1.0"7     signingConfig signingConfigs.config8     multiDexEnabled true9   }

         (3)在 AndroidManifest.

1 <?2 <manifest 3   package="com.example.android.multidex.myapplication">4   <application5     ...6     android:name="android.support.multidex.MultiDexApplication">7     ...8   </application>9 </manifest>

   提示:如果你的应用程序继承 Application , 那么你需要重写     

1 @Override2   protected void attachBaseContext(Context base) {3     super.attachBaseContext(base);4     MultiDex.install(this) ;5   }

 

另外我的微信公众账号是: zhaoyanjun125  

我会经常发一些我的些项目的感悟和编程技术。欢迎关注。

 微信扫描二维码 关注我

  如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

 

 

 

 

        

 




原标题:如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

tiktok别人关注不了我:https://www.goluckyvip.com/tag/82293.html
https://tiktok:https://www.goluckyvip.com/tag/82294.html
tiktok独立ip:https://www.goluckyvip.com/tag/82295.html
tiktok appstore:https://www.goluckyvip.com/tag/82296.html
tiktok运营商:https://www.goluckyvip.com/tag/82297.html
tiktok采集:https://www.goluckyvip.com/tag/82298.html
独家丨B站广告位可跳转美团APP B站为电商平台引流再升级 :https://www.kjdsnews.com/a/1836410.html
百崖大峡谷生态旅游景区(探秘中国西南自然风光):https://www.vstour.cn/a/363176.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流