Eclipse移植Android Studio Gradle编译报Execution failed for task 文件混淆错误input jar file is specified twice

本文介绍了如何解决Gradle项目中因重复引入同一Jar包而导致的构建失败问题。通过调整build.gradle配置和proguard-rules.pro文件,可以有效避免此类错误。

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

提示如下错误:
 Warning:Exception while processing task java.io.IOException: The same input jar [G:\test\Jooan\app\libs\universal-image-loader-1.9.3.jar] is specified twice.

Hello World 2016/6/29 9:30:56

:app:transformClassesAndResourcesWithProguardForRelease FAILED

Hello World 2016/6/29 9:31:00

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: The same input jar [G:\test\Jooan\app\libs\universal-image-loader-1.9.3.jar] is specified twice.

解决思路:
删除  -libraryjars libs/***.jar from your proguard-rules.pro file.
找到:

原因是build.gradle文件配置了


dependencies {     compile fileTree(include: '*.jar', dir: 'libs')

}

里面已经添加过jar包,混淆文件proguard-rules.pro里面又加了句-libraryjars libs/***.jar,将-libraryjars libs/***.jar 前面用#号注释或者直接删掉即可。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值