Android解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
来源:互联网 发布:linux 打开终端 编辑:程序博客网 时间:2024/05/18 01:51
1.报错情况:
Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536 at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277) at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)
2.解决方法
在app build.gradle 中添加以下内容:
android{ defaultConfig { multiDexEnabled true } dexOptions { incremental true javaMaxHeapSize "4g" }}dependencies { compile 'com.android.support:multidex:1.0.0'}
3.(不能省, 博主因为少了这个在不同的手机里面, ImageLoader 编译会出错) 如果你的工程中已经含有Application类,那么让它继承android.support.multidex.MultiDexApplication类,
如果你的Application已经继承了其他类并且不想做改动,那么还有另外一种使用方式,覆写attachBaseContext()方法:
public class MyApplication extends Application { /** 复制下面方法 */ @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } }
4.编译运行即可
1 0
- Android 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Android解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- 解决com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android学习笔记----解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Android学习笔记----解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android Studio——com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- Android studio打包错误com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- (转)Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- 关于com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536的解决方法
- “com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题解决
- 异常com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- 错误ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- WPF绘制自定义窗口
- Flask迁移数据库
- DOM4J
- 查找循环有序数组的元素
- 最长公共子序列
- Android解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Introduction to Machine Learning【转】
- 设计模式:备忘录模式(Memento)
- 数据库分库分表(sharding)系列(二) 全局主键生成策略
- 数据库索引的实现原理
- Hbase总结(十)Hhase性能调优
- git上传新项目到git地址
- Xilinx中的xapp1052理解
- C语言 位运算