Android 打包签名DexIndexOverflowException错误解决
2016-10-12 10:53
423 查看
应用要使用谷歌地图服务,集成了Google Play Services,使用Android Studio打包release版本编译的时候出现如下错误:
DexIndexOverflowException,从名字上看是Dex的Index溢出了。在stackoverflow上看到64K的说法:
当出现这个错误时说明你本身自己的工程代码中含有的太多的方法,或者你的工程lib文件夹下引用的第三方插件jar包有太多的方法,这两者的方法加起来已经超过了65536这个数目。而谷歌规定单个dex文件中的方法不能超过65536的限制
解决方案如下,修改module的build.gradle:
这样就解决了DexIndexOverflowException这个异常:
Error:Execution failed for task ':watchclient:transformClassesWithDexForRelease'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
DexIndexOverflowException,从名字上看是Dex的Index溢出了。在stackoverflow上看到64K的说法:
当出现这个错误时说明你本身自己的工程代码中含有的太多的方法,或者你的工程lib文件夹下引用的第三方插件jar包有太多的方法,这两者的方法加起来已经超过了65536这个数目。而谷歌规定单个dex文件中的方法不能超过65536的限制
解决方案如下,修改module的build.gradle:
dependencies { ... compile 'com.android.support:multidex:' ... }
android { ... defaultConfig { ... multiDexEnabled true ... } ... }
这样就解决了DexIndexOverflowException这个异常:
相关文章推荐
- Android 打包签名DexIndexOverflowException错误解决
- Android编译出现com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536错误解决办法
- 解决打包时 DexIndexOverflowException: Cannot merge new index 65771 into a non-jumbo 错误
- 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编译出现com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536错误时的处理
- (转)Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- 错误ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- Android解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- 解决Android单个dex文件不能超过65536个方法问题,DexIndexOverflowException
- “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”问题
- 解决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
- Android studio 报错 java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowExcep 解决方
- 解决Error:Android Dex: com.android.dex.DexIndexOverflowException: Cannot merge new index 65918 into a
- Android Studio 错误 com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536