I'm facing an issue with Jackson and Kotlin Data classes when enabling Proguard. Jackson version: 2.9.1 Jackson Converter version: 2.3.0 Kotlin version: 1.2.51
Here's my proguard file:
-ignorewarnings
# Jackson 2.x
-keepclassmembers class com.jgarin.remote.models.** {
<init>(...);
<fields>;
}
-keepclassmembers class * {
@com.fasterxml.jackson.annotation.JsonCreator *;
@com.fasterxml.jackson.annotation.JsonProperty *;
}
#Required for Kotlin!
-keep class kotlin.Metadata { *; }
-keep class kotlin.reflect.** { *; }
-keepclassmembers public class com.jgarin.** {
public synthetic <methods>;
}
-keepattributes SourceFile,LineNumberTable,*Annotation*,EnclosingMethod,Signature,Exceptions,InnerClasses
Still, the app fails, throwing an exception:
E/RxCallAdapterWrapper: Retrofit exception occurred
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.jgarin.remote.models.responses.GetVerificationCodeResponse` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
The rest of the stack trace is pretty much useless. I'm pretty sure I'm missing something obvious. Any help is appreciated. Thank you.