Hi, I'm using moshi+retrofit and trying to sort out proguard setup
I have a class:
data class PingResponse(
@Json(name = "needs_update") val shouldUpdate: Boolean,
)
And it works fine in debug, but with release minification it crashes with the following:
IllegalArgumentException: No property for required constructor parameter #0 shouldUpdate of fun `<init>`(kotlin.Boolean): not.minimized.package.PingResponse
It works fine if I apply
@JsonClass(generateAdapter = true)
to class.
As per
documentation it sounds like I only need to apply
@JsonClass(generateAdapter = false)
to enums, and the rest should work out of the box.
I find it very tricky that it works in debug without this annotation but fails in release.
This comment suggests not minimizing all the models, but I don't find it much useful in my case, as I don't store all the models in one package.
I can apply
@JsonClass(generateAdapter = true)
to all my models, the biggest issue is that if I forget to do that I won't know there's a problem until I run release version.
Am I missing some other way to set it up, or is there a way to make app crash in debug(or build time check?), same as it does in release, in case when model has no
JsonClass
annotation?