使用杰克逊JSON库使用Proguard的问题时, [英] Problems with using jackson-json library when using Proguard

查看:909
本文介绍了使用杰克逊JSON库使用Proguard的问题时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在Android项目的杰克逊JSON库,并在使用Proguard的混淆用于导出应用程序时,我收到以下错误:

I'm using the jackson-json library in an Android project, and when exporting the app while using Proguard for obfuscation, I get the following errors:

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包括其他罐子,和许多其他的东西,但没有任何帮助。

I've tried to play with the settings of the project, add "-libraryjars" to include other jars, and many other things, but nothing helped.

推荐答案

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

ok , i've added the next things that i've gathered from multiple websites:

-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.**

与下一个$ C $下是用于JSON每个类(使用get&安培;套),我认为正在创建APK,但我不知道如果我已经写就足以使它做工精良,并且如果一些什么我已经写是没有必要:

together with the next code for each class that is used for json(with get&set), i think the apk is being created but i'm not sure if what i've written is enough to make it work well , and also if some of what i've written is not needed :

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

这篇关于使用杰克逊JSON库使用Proguard的问题时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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