Unable to execute dex: Multiple dex files define Lorg/apache/commons/collections/FastHashMap;

本文解决Android项目打包时遇到的错误,包括忽略内类警告和多Dex文件定义冲突的问题。通过检查并移除重复依赖的jar包,成功解决了打包失败的问题。提供了解决步骤及更多相关解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

android在打包的时候出错,昨天晚上还好好的,今天早上起床后打开项目就出错了,网上有很多办法都适合,差距太远

异常代码提示:[2015-03-29 10:08:13 - 农产品推广平台] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class

(org.apache.commons.logging.LogFactory$6) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2015-03-29 10:08:15 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/commons/collections/FastHashMap;

[2015-03-29 10:08:15 - 农产品推广平台] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/commons/collections/FastHashMap;

然后就导致打包的时候老是出错


解决办法,找所引用的jar包中,所包含的包或者类有没有重复的,删除重复的就可以了


更多解决办法请参考其他文章:http://blog.youkuaiyun.com/mxlxiao7/article/details/8978930

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值