带有外部 jar 的 Android Proguard [英] Android Proguard with external jar

查看:37
本文介绍了带有外部 jar 的 Android Proguard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将外部 jar 文件添加到 mt 项目的 libs 文件夹中,并在构建路径中对其进行配置.当我尝试导出 Android 包"时,我收到了许多未找到的参考类的 Proguard 错误消息,例如:警告:com.itextpdf.text.BaseColor:找不到引用的类 java.awt.Color

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

当我尝试调试 BaseColor 类时工作正常,所以我不明白为什么它会警告我.

When i tried to debug the BaseColor class worked fine, so i can't figure out why does it warns me.

任何帮助将不胜感激,

谢谢

推荐答案

我尝试了好几天让外部 jars 正常工作.有人建议做一些事情,比如下载引用的 jars 或正确定义 libjars.这些都不适合我.
什么工作是把这种东西放在出错的 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:

-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.slf4j.**
-dontwarn org.json.*

还有这个:

-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }

(显然您需要调整它以匹配您的错误消息)

(Obviously you will need to adjust this to match your error messages)

祝你好运.

这篇关于带有外部 jar 的 Android Proguard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆