解决方法数超65536(java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536)
来源:互联网 发布:淘宝入驻协议书 编辑:程序博客网 时间:2024/06/11 14:07
随着功能的增加,项目一天天的变大,慢慢的都会遇到单个dex最多65535个方法数的瓶颈。
最近在开发过程中我就遇到了以下问题:
- java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536;
Gradle真是个强大的发明,非常简单的就解决了这个问题,以下简单的记录一下解决办法。
第一步:在defaultConfig节点 设置muli]tiDexEnable 为true.
android { defaultConfig { // dex突破65535的限制 multiDexEnabled true } }
第二步:然后就是引入multidex库文件.
dependencies { compile 'com.android.support:multidex:1.0.0' }
第三步:你的AppApplication继承一下MultiDexApplication.
public class MyApplication extends MultiDexApplication { @Override public void onCreate() { super.onCreate(); }
最后给出最终的build.gradle文件:
apply plugin: 'com.android.application'android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "wenld.moon.httpnet" minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName versionProps['VERSION_CODE'].toString() multiDexEnabled true }}dependencies { compile 'com.android.support:multidex:1.0.0'}
参考:http://frank-zhu.github.io/android/2015/06/15/android-release_app_build_gradle/;
http://blog.csdn.net/x_i_a_o_h_a_i/article/details/46544341;
0 0
- 解决方法数超65536(java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536)
- UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65
- method ID not in [0, 0xffff]: 65536
- method ID not in [0, 0xffff]: 65536” error解决办法
- DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- 关于com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536的解决方法
- Unable to execute dex: method ID not in [0, 0xffff]: 65536 的解决方案
- Unable to execute dex: method ID not in [0, 0xffff]: 65536 问题解决方法
- Unable to execute dex: method ID not in [0, 0xffff]: 65536资料
- Unable to execute dex: method ID not in [0, 0xffff]: 65536
- Android Studio出现Unable to execute dex: method ID not in [0, 0xffff]: 65536
- 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Unable to execute dex: method ID not in [0, 0xffff]: 65536
- Android 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Unable to execute dex: method ID not in [0, 0xffff]: 65536
- Android Studio 遇到 “method ID not in [0, 0xffff]: 65536” error
- “com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题解决
- Unity3D-启动unity事件,切换平台监听
- POJ 1002
- Python+Scrapy+Redis+Mongodb 环境安装
- oracle 函数
- 解决Android Genymotion模拟器library "/system/lib/libhoudini.so" not found报错问题
- 解决方法数超65536(java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536)
- FPGA 视频拼接器 动态欢迎词的实现
- split多个分隔符
- Exporting a function in a DLL using Microsoft Visual C++ 6.0
- vm中centos扩展硬盘空间
- android studio 签名 报错Error:(3) Error: "app_name" is not translated in "de" (German), "es" (Spanish),
- github上的提交数统计
- Android网络通信库Volley简介
- 第一章 对象导论1.3/1.4合并