2012-06-14 59 views
15

我使用的杰克逊JSON库在Android项目,在使用杰克逊JSON库,同时使用了模糊处理Proguard的导出应用程序时出现的问题,我得到以下错误:使用Proguard的

Proguard returned with error code 1. See console 
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry 
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry 
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry 
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry 
Warning: com.fasterxml.jackson.databind.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry 
You should check if you need to specify additional program jars. 
Warning: there were 5 unresolved references to classes or interfaces. 
You may need to specify additional library jars (using '-libraryjars'). 
java.io.IOException: Please correct the above warnings first. 
at proguard.Initializer.execute(Initializer.java:321) 
at proguard.ProGuard.initialize(ProGuard.java:211) 
at proguard.ProGuard.execute(ProGuard.java:86) 
at proguard.ProGuard.main(ProGuard.java:492) 

我试图玩这个项目的设置,添加“-libraryjars”来包含其他的jar和许多其他的东西,但没有任何帮助。

回答

37

好了,我还说,我已经从多个网站收集接下来的事情就:

-libraryjars libs/jackson-annotations-2.0.0.jar 
-libraryjars libs/jackson-core-2.0.0.jar 

-dontskipnonpubliclibraryclassmembers 

-keepattributes *Annotation*,EnclosingMethod 

-keepnames class org.codehaus.jackson.** { *; } 

-dontwarn javax.xml.** 
-dontwarn javax.xml.stream.events.** 
-dontwarn com.fasterxml.jackson.databind.** 
与用于JSON(与得到&集)每类下一个代码

在一起,我认为正在创建APK,但我不知道如果我已经写了足以令它的工作好,同时如果一些我写的东西是不需要的:

-keep public class MyClass.** { 
    public void set*(***); 
    public *** get*(); 
} 
+2

不错...这是没有任何问题的工作。 –

+1

也为我工作,谢谢。 –

+1

我没有最小化这里的命令。如果有人能告诉我哪些线路不需要,请告诉我。 –