proguard 地狱 - 找不到引用的类 [英] proguard hell - can't find referenced class

查看:39
本文介绍了proguard 地狱 - 找不到引用的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我尝试发布一些软件,但 Proguard 让我很头疼.

So, I'm TRYING to release some software but Proguard is giving me a headache.

当我尝试使用 proguard 导出时,我收到很多警告,即找不到引用的类"

When I try to export using proguard I'm getting lots of warning ie "can't find referenced class"

例如:

[2011-08-07 17:44:37 - GAME] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2011-08-07 17:44:37 - GAME] Warning: there were 52 unresolved references to classes or interfaces.
[2011-08-07 17:44:37 - GAME]          You may need to specify additional library jars (using '-libraryjars'),
[2011-08-07 17:44:37 - GAME]          or perhaps the '-dontskipnonpubliclibraryclasses' option.
[2011-08-07 17:44:37 - GAME] java.io.IOException: Please correct the above warnings first.
[ 

警告似乎与 simpleframework 有关,因此在我的 proguard 配置文件中,我添加了以下内容:

The warnings seem to related to simpleframework, so in my proguard config file I've added the following:

-libraryjars pathtoprojecttolibssimple-xml-2.4.jar

其中 pathtoprojecttolibs 是我的项目引用的 jar 的路径.

Where pathtoprojecttolibs is the path to jars which are referenced by my project.

这没什么区别.

如果 simpleframework 引用 javax,我可以告诉 proguard 也忽略它吗??

If simpleframework references javax can I tell proguard to ignore this too??

有什么想法吗?

推荐答案

出现此错误是因为您使用的库依赖于其他未真正使用的库,但 Proguard 正在寻找它们.
-dontwarn 行添加到 Android 项目中的 proguard-rules.pro 文件以禁用此警告.

This error occurs because the libs you use depend on other libs which are not realy used, but Proguard is looking for them.
Add your -dontwarn lines to your proguard-rules.pro file in your Android project to disable this warnings.

您可以在错误的堆栈跟踪中找到需要添加到 proguard-rules.pro 中的依赖项.

You can find which dependencies you need to add to your proguard-rules.pro in the stacktrace of your error.

这篇关于proguard 地狱 - 找不到引用的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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