Android Proguard 与外部 jar
我已将外部 jar 文件添加到 mt 项目的 libs 文件夹中,并在构建路径中配置它。 当我尝试“导出 Android 包”时,我收到一条 Proguard 错误消息,其中包含许多未找到的参考类,例如: 警告:com.itextpdf.text.BaseColor:找不到引用的类 java.awt.Color
当我尝试调试 BaseColor 类工作正常时,所以我不明白为什么它会警告我。
任何帮助将不胜感激,
谢谢
I'm have added external jar file to the libs folder of mt project and configure it in the build path.
When i try to "Export Android Package" i receive a Proguard error message for a lot of reference classes that aren't found, For example:
Warning: com.itextpdf.text.BaseColor: can't find referenced class java.awt.Color
When i tried to debug the BaseColor class worked fine, so i can't figure out why does it warns me.
Any help will be appreciated,
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我尝试了几天让外部罐子正常工作。有人建议做一些事情,比如下载引用的 JAR 或正确定义 libjar。这些都不适合我。
有效的方法是将此类内容放入出错的 JARS 中:
以及:(
显然,您需要调整它以匹配您的错误消息)
祝您好运。
I tried for days to get external jars properly working. There were suggestions to do things like download the referenced JARS or properly define libjars. None of these worked for me.
What did work was putting this sort of thing in for the JARS that errored:
and this:
(Obviously you will need to adjust this to match your error messages)
Good luck.
我猜,
com.itextpdf.text.BaseColor
包含在您添加的 jar 中。它扩展了java.awt.Color
,它不包含在其中,但包含在您在 Eclipse 下使用的 Java 发行版中。当您导出文件时,导出过程被卡住为
java.awt.color
Android 基础框架中不存在。我不认为这与 Proguard 有关:即使您禁用混淆,这也一定会发生。com.itextpdf.text.BaseColor
is included in the jar you have added, I guess. It extendsjava.awt.Color
which is not included in it but in the distribution of Java you are using under Eclipse.When you are exporting the file, the export process is jammed as
java.awt.color
doesn't exist in the Android base framework. I don't think this is related to Proguard: this must happen even if you disable the obfuscation.