I have enabled Proguard and added proper proguard rules for all the libraries I am using.
I use Retrofit for network calls and Jackson converter for parsing responses.
My Json responses have root values, to parse this using Jackson I use setting SerializationFeature.WRAP_ROOT_VALUE
and DeserializationFeature.UNWRAP_ROOT_VALUE
. Everything was working till I applied proguard.
Without giving any parsing exceptions the fields are parsed as null values.
The Proguard rules I am using for Jackson are
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.*
-keepattributes *Annotation*,EnclosingMethod,Signature
-keep class org.codehaus.** { *; }
-keepclassmembers public final enum
org.codehaus.jackson.annotate.JsonAutoDetect$Visibility {
public static final org.codehaus.jackson.annotate.JsonAutoDetect$Visibility *;
}
-keepclasseswithmembers class com.jombay.vger.rx.resources.** {
public protected private <init>(...);
public void set(*);
public ** get*();
}
-keepclasseswithmembers public class com.jombay.vger.retrofit.resources.** {
public protected private <init>(...);
public void set(*);
public ** get*();
}
-keepclasseswithmembers public class com.jombay.vger.utils.** {
public protected private <init>(...);
}
-keepclassmembers class * {
@org.codehaus.jackson.annotate.* *;
}
-keep class com.fasterxml.jackson.databind.ObjectMapper {*;}
-keep class com.fasterxml.jackson.databind.ObjectWriter {*;}
I have come up with this configuration after resolving lot of other issues.
Not able to debug and understand the issue here.