解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
来源:互联网 发布:sql 动态生成临时表 编辑:程序博客网 时间:2024/06/06 01:35
错误:Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a non-jumbo instruction!
如下图:
直接原因是Java代码太多,jar包太多。
谷歌官方文档已经有解决方案:http://developer.android.com/intl/zh-cn/tools/building/multidex.html
点击打开链接
eclipse的解决方案:在项目中的这个文件project.properties中添加一句话:dex.force.jumbo=true,如图:
Android studio 解决方案,需要几个步骤:
第一步,添加 multiDexEnabled = true,如图:
第二步,添加依赖于你的build.gradle支持MultiDex库,如图:
第三步分3个情况,
如果你没有创建自己的Application 类,在你的清单文件AndroidManifest.xml中配置android.support.multidex.MultiDexApplication就可以了。
android:name="android.support.multidex.MultiDexApplication"
如果你有自己的Application类了,让它继承 android.support.multidex.MultiDexApplication而不是android.app.Application
如果你的Application继承了其他的类,并且你不想改变或者没办法改变。按照下面的方法重写attachBaseContext(),
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
如果没有第二和第三步,可能有些手机运行时会报错,如图:
好了,重新编译,可以通过了,又可以愉快的玩耍了……
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- 解决ERROR:ANDROID DEX: COM.ANDROID.DEX.DEXINDEXOVERFLOWEXCEPTION: CANNOT MERGE NEW INDEX 66220 INTO A
- com.android.dex.DexIndexOverflowException: Cannot merge new index 66299 into a non-jumbo instruction
- Cause: com.android.dex.DexIndexOverflowException: Cannot merge new index 68696 into a non-jumbo insr
- com.android.dex.DexIndexOverflowException: Cannot merge new index 65730 into a non-jumbo instructio
- com.android.dex.DexIndexOverflowException: Cannot merge new index 66078 into a non-jumbo instruction
- com.android.dex.DexIndexOverflowException: Cannot merge new index 68257 into a non-jumbo instruction
- Android 方法数越界65536 com.android.dex.DexIndexOverflowException: Cannot merge new index 67515 into a no
- Android Error in Eclipse: “Unable to execute dex: Cannot merge new index 66904 into a non-jumbo inst
- com.android.dex.DexIndexOverflowException
- Android编译遇到-Unable to execute dex: Cannot merge new index 65761 into a non-jumbo instruction!
- Unable to execute dex: Cannot merge new index 65552 into a non-jumbo instruction!
- 异常分析:Unable to execute dex: Cannot merge new index 71813 into a non-jumbo instruction!
- 关于“Unable to execute dex: Cannot merge new index 65576 into a non-jumbo instruction!”
- Unable to execute dex: Cannot merge new index 67208 into a non-jumbo instruction!解决方案
- Unable to execute dex: Cannot merge new index 65979 into a non-jumbo instruction!
- sublime 3 自定义配置
- halcon程序初级学习(一)
- Android emulator中C代码的调试——gdb/gdbservers时遇到的坑
- 再谈如何将android studio项目转换成eclipse
- 给libvirt创建的虚拟机指定固定IP
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- 各个地图提供商的坐标系
- #Android学习#Fragment简单基础——Tabbed Activity使用
- cluster_session解决方案
- 学习opencv-Laplacian图像融合
- EasyUI 创建简单窗口
- 分析源码到底是为了什么
- DBLP数据集简介及简单用法
- Centos6.6通用预编译包方式安装MySQL 5.7.10