Android Studio 编译报错 Error:Error converting bytecode to dex: Cause: com.android.dex.DexIndexOverflowE

来源:互联网 发布:数据库使用表语句 编辑:程序博客网 时间:2024/06/01 23:06

用AS导入了一个eclipse开发的apk时,报了如下的错:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexIndexOverflowException: Cannot merge new index 66678 into a non-jumbo instruction!

借鉴了网上大家的方法,现在把我的解决方法记录下来

1.在项目的build.gradle文件的dependencies 节中添加分包设置

dependencies {
...    compile'com.android.support:multidex:1.0.0'
...
}
2.通过在defaultConfig节中设置multiDexEnabled标签为true,开启multi-dexing支持.
defaultConfig {...    multiDexEnabled true
...}
3.大家有说在AndroidManifest.xml文件的Application声明中添加:
android:name="android.support.multidex.MultiDexApplication"
我没用添加。。。
4.重新build,生成APK
参考如下链接
http://www.cnblogs.com/yeahgis/p/4660873.html

0 0
原创粉丝点击