Closed mirmousaviii closed 7 years ago
Investigated into my project using moshi-jsonapi. Seems that the project is obfuscated completely and everything works just ok...
With the library obfuscated as well... (actually, I have no idea about why it's obfuscated after I added these proguard rules)
BTW, the message
platform java.util.LinkedHashMap<java.lang.String,a.a.a.j> annotated [] requires explicit JsonAdapter to be registered
is to say that moshi is trying to deserialize someclass that have a field type of a.a.a.j
but moshi could not find an adapter for that type. In most cases, it's a case of Enum that you've ever defined a JsonAdapter for. And maybe you need these proguard rules for moshi if you've defined a custom JsonAdapter:
-keepclassmembers class ** {
@com.squareup.moshi.FromJson *;
@com.squareup.moshi.ToJson *;
}
I use this code in proguard and resolved.
-keepclassmembers public abstract class moe.banana.jsonapi2.** {
*;
}
Thank you
But I have no idea why it works 😥😥😥
Anyway, I'll add that to README, thanks.
I used moshi-jsonapi and I have error in build signed apk (release mode), I used
dontwarn
inproguard-rules.pro
for pass the build signed apk, But my application in signed mode every time run onFailure from Callback. Throwable message:platform java.util.LinkedHashMap<java.lang.String,a.a.a.j> annotated [] requires explicit JsonAdapter to be registered
I never have used LinkedHashMap, But when use moshi-jsonapi I have error in build. proguard-rules.pro: