【发布时间】:2012-03-05 22:59:54
【问题描述】:
我正在尝试在使用 android 库项目的 android 应用程序 中使用 proguard,但出现以下错误:
java.io.IOException: Can't write
[/private/var/folders/Pg/PgUpPJQ-E5qxL7jX6kpdCE+++TI/-Tmp-/android_3140050575281008652.jar]
(Can't read [proguard.ClassPathEntry@1f8d244]
(Duplicate zip entry
[be.class == android_144638064543155619.jar:com/comp/dp/library/R$anim.class]))
at proguard.OutputWriter.writeOutput(OutputWriter.java:224)
at proguard.OutputWriter.execute(OutputWriter.java:120)
at proguard.ProGuard.writeOutput(ProGuard.java:391)
at proguard.ProGuard.execute(ProGuard.java:152)
at proguard.ProGuard.main(ProGuard.java:499)
我的 proguard.cfg 文件是 this 以及一些 -libraryjars 指的是 rt.jar 和几个其他依赖库。
我的猜测是这个问题与使用图书馆项目有关,并且 proguard 试图两次处理图书馆项目的条目。但我不确定我应该使用哪些选项来解决这个问题。
非常感谢任何建议/方向。
更新 1: 通过删除 -injars bin/classes 我能够解决这个问题。我的猜测是,因为 proguard 处理库项目和应用程序项目,所以库项目的 .class 文件被处理了两次。一次在库项目的bin/classes 文件夹中,另一次在应用程序项目的bin/classes 文件夹中。
【问题讨论】:
-
By removing the -injars bin/classes- 那在哪里?