ProGuard的地狱 - 无法找到引用的类地狱、ProGuard

2023-09-12 01:14:30 作者:丿书香丶名第

所以,我的 TRYING 的释放一些软件,但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 pathtoprojecttolibs\simple-xml-2.4.jar

其中, pathtoprojecttolibs 是路径罐子这是由我的项目中引用。

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

这没什么区别。

如果使用javax我可以告诉ProGuard的simpleframework引用忽视这一点?

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

任何想法?

推荐答案

org.simpleframework.xml.stream.StreamReader 在code指的 javax.xml.stream.events.XMLEvent 。后一类是Java运行时的一部分(的rt.jar ),但在Android运行时(而不是一部分的android.jar ),这样的ProGuard警告说,一些可能被打破。如果你确信你的应用程序的工作,无论如何,你可以指定

org.simpleframework.xml.stream.StreamReader in your code refers to javax.xml.stream.events.XMLEvent. The latter class is part of the Java runtime (rt.jar) but not part of the Android runtime (android.jar), so ProGuard warns that something might be broken. If you're sure that your application works anyway, you can specify

-dontwarn javax.xml.stream.events.**

ProGuard的地狱?

ProGuard hell?