Android Studio Gradle编译报input jar file is specified twice

原文地址: http://blog.csdn.net/X_i_a_o_H_a_i/article/details/41979983

Eclipse项目中的混淆配置文件 复制到AS中 在混淆的过程中提示如下错误

Android Studio Gradle编译报input jar file is specified twice_第1张图片

Error:Execution failed for task ':app:proguardDemoRelease'.
> java.io.IOException: The same input jar [D:\Users\workspace_studio\Test5\app\libs\fastjson.jar] is specified twice. 


解决方案:

删除  -libraryjars libs/***.jar from your proguard-rules.pro file.


Android Studio Gradle编译报input jar file is specified twice_第2张图片

原因是build.gradle文件配置了


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

}

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

你可能感兴趣的:(android,gradle,ProGuard,Studio)