問題產(chǎn)生
在Android Stduio上對apk進(jìn)行混淆打包時编兄,發(fā)生了如下錯誤:
Warning:Exception while processing task java.io.IOException: The same input jar [xxxx.jar] is specified twice.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
日志里提示我們同一個輸入的jar包被指定了兩次
產(chǎn)生原因
是因為我們在app的build.gradle中已經(jīng)使用compile fileTree(include: ['*.jar'], dir: 'libs')
命令添加jar包票唆,
然后又在混淆文件proguard-rules.pro里面又在對jar包內(nèi)容進(jìn)行免混淆配置時使用了-libraryjars libs/xxx.jar
所致狼速。
解決方法
去除或注釋混淆文件proguard-rules.pro里面的-libraryjars libs/xxx.jar
語句即可蓖宦。
【參考自】The same input jar is specified twice 解決辦法
如果您有更好的解決方案歡迎評論分享艺骂,如有錯誤藕坯,請批評指正,謝謝群凶。