一:问题描述: 应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了. 二、解决方案: 方案1:使用插件化框架 比如: https://github.com/singwhatiwanna/dynamic-lo ...
一:问题描述:
应用中的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 }
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。