GithubHelp home page GithubHelp logo

Comments (8)

goonerDroid avatar goonerDroid commented on May 22, 2024 5

@krschultz Finally found my proguard config for Jackson Proccessor.My Config is as follows:-

-keepattributes Annotation,EnclosingMethod,Signature
-keepnames class com.fasterxml.jackson.* { ; }
-dontwarn com.fasterxml.jackson.databind.

-keep class org.codehaus.* { ; }
-keepclassmembers public final enum org.codehaus.jackson.annotate.JsonAutoDetect$Visibility {
public static final org.codehaus.jackson.annotate.JsonAutoDetect$Visibility *; }
-keep public class your.class.
* {
public void set_(_
);
public *
* get*();
}

your.class here is the getter/setter you are using to parse the response

also keep in mind to compile the same versions of Jackson Library.In my case i am using

compile 'com.fasterxml.jackson.core:jackson-databind:2.4.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.2'
compile 'com.fasterxml.jackson.core:jackson-core:2.4.2'

from android-proguard-snippets.

krschultz avatar krschultz commented on May 22, 2024 1

@goonerDroid I dropped the ball on this. I reopened it at the time because although you posted the config here, we never actually put it into a file in the libraries folder. This is what we currently have:

# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)

-keep class com.fasterxml.jackson.databind.ObjectMapper {
    public <methods>;
    protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
    public ** writeValueAsString(**);
}

from android-proguard-snippets.

krschultz avatar krschultz commented on May 22, 2024

@goonerDroid good point. I do actually have configuration for that in one of my projects, I'll add it to the library.

from android-proguard-snippets.

goonerDroid avatar goonerDroid commented on May 22, 2024

@krschultz hey added the config but i get the following crash.
E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.crap, PID: 10579
java.lang.NoSuchFieldError: PUBLIC_ONLY
at java.lang.Class.getDeclaredAnnotation(Native Method)
at java.lang.Class.getAnnotation(Class.java:290)
at com.fasterxml.jackson.databind.f.ai.(Unknown Source)
at com.fasterxml.jackson.databind.ObjectMapper.(Unknown Source)
at com.crap.utils.c.(Unknown Source)
at com.crap.main.d.a(Unknown Source)
at com.crap.main.b.a.a(Unknown Source)
at com.crap.main.b.a.onCreateView(Unknown Source)
at android.app.Fragment.performCreateView(Fragment.java:1700)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)

Also i added the following to the proguard config:-
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry

from android-proguard-snippets.

krschultz avatar krschultz commented on May 22, 2024

Try disabling obfuscation in the proguard-project.pro file and see if it works. Obviously you wouldn't want that permanently, but I want to see if that fixes it. I'm pulling the Jackson config from a project with obfuscation turned off.

-dontobfuscate

from android-proguard-snippets.

urvish91 avatar urvish91 commented on May 22, 2024

-keepnames class com.fasterxml.jackson.** { ; }
-dontwarn com.fasterxml.jackson.databind.

Just add this and add in gradle this.

you need to add * in bracket{ } before semicolon

compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.3'

it will work definitely.

from android-proguard-snippets.

goonerDroid avatar goonerDroid commented on May 22, 2024

Dunno why @krschultz reopened this issue rules posted by me is working fine!

from android-proguard-snippets.

christhoval06 avatar christhoval06 commented on May 22, 2024

@goonerDroid work fine for me

thanks

from android-proguard-snippets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.