Comments (8)
@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.
@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.
@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.
@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.
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.
-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.
Dunno why @krschultz reopened this issue rules posted by me is working fine!
from android-proguard-snippets.
@goonerDroid work fine for me
thanks
from android-proguard-snippets.
Related Issues (20)
- Add rules for jsoup
- Add Sinch Voice,Video and Verification,MagnetMessage snippets.Thanks
- unknown reference to sun.misc.Unsafe in play-services HOT 3
- proguard-google-play-services.pro no longer needed
- .DS_Store on osx is making the build fail
- Leak Canary
- Greendao Proguard not up to date
- error while adding multiple proguard directory in release type HOT 11
- Doesn't work with Build Tools 2.2.3 HOT 2
- Get specific for test libs too
- proguard-project.pro
- Can you add proguard for PrettyTime?
- how to hide class names and activity names while reverse engineering
- After Applying Proguard Cannot take build
- Add Proguard for Tesseract OCR library com.rmtheis:tess-two:9.0.0 HOT 2
- proguard doesn't updated HOT 1
- Add Parceler HOT 1
- Upstream configuration on Android specific libraries
- I need follow additional libraries,can you give me,thank you?
- Guava EventBus config missing keepclassmembers for annotated methods HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-proguard-snippets.