Conversion to Dalvik format failed:Unable toexecute dex: method ID not in [0, 0xffff]: 65536
2015-09-18 16:06
507 查看
关于方法数超限,Google官方给出的方案是这样的:https://developer.android.com/intl/zh-cn/tools/building/multidex.html
我也写过一个文章记录了一下。http://www.cnblogs.com/shansheng/p/4791896.html
但是,[ as + multi-dex ] - 65536 != 0 这是必然的。
其实很多时候还是使用了第三方的库,但是很多库的方法我们是没有用到的。这个时候我们特别需要将不用的代码直接就不打进包的。
解决方案:
开启proguard
经过测试,android官方的混淆文件是会将不用的方法混淆不打包进去的。这样就避免了使用第三方包很多东西不用的问题。于是问题解决.另外这是android studio的解决方案。
我也写过一个文章记录了一下。http://www.cnblogs.com/shansheng/p/4791896.html
但是,[ as + multi-dex ] - 65536 != 0 这是必然的。
其实很多时候还是使用了第三方的库,但是很多库的方法我们是没有用到的。这个时候我们特别需要将不用的代码直接就不打进包的。
解决方案:
开启proguard
release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' signingConfig signingConfigs.release }
经过测试,android官方的混淆文件是会将不用的方法混淆不打包进去的。这样就避免了使用第三方包很多东西不用的问题。于是问题解决.另外这是android studio的解决方案。
相关文章推荐
- nonatomic, retain,weak,strong用法详解
- Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE
- GTS Test fail testTestTelephonyCall_bindsToInCallServiceAndAddsCall
- boost的安装问题 http://blog.csdn.net/begtostudy/article/details/1879213
- [Leetcode] Container With Most Water
- Learning to rank的讲解,单文档方法(Pointwise),文档对方法(Pairwise),文档列表方法(Listwise)
- [Leetcode] 11 Container With Most Water
- Codeforces Round #319 (Div. 1)E.Painting Edges(并查集)
- Contains Duplicate II
- HDU 4819 Mosaic D区段树
- Contains Duplicate
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- Magic Pairs - SGU 119(同余)
- 升级xcode7之后,真机调试出现BaiduMapAPI.framework/BaiduMapAPI(BMAddrList.o)' does n 4000 ot contain bitcode的问题
- INSTALL_FAILED_DUPLICATE_PERMISSION
- Contains Duplicate 重复数的判断
- 端口状态说明 LISTENING、ESTABLISHED、TIME_WAIT及CLOSE_WAIT
- SSH 错误解决案例1:Read from socket failed: Connection reset by peer
- grails Tags
- grails自定义标签