JakeWharton/retrofit2-kotlinx-serialization-converter

minifyenabled issue

akhilsreekar opened this issue · 3 comments

When I am trying to set minifyEnabled = true, then I am getting the following error.
Else it is working properly.

java.lang.IllegalArgumentException: Unable to create converter for d.g.a.k.m.c<d.g.a.k.m.s>
for method d.k

Couldn't understand whats the reason.

Well to start with you need the full stack trace and to run retrace on it so that it becomes unobfuscated. Only then can you start trying to figure out the cause of the exception (such as missing shrinker rules). At present, it's impossible to know and the fact that it works when minification is disabled likely means it's not an issue with this library itself but your usage of this library in the context of a shrinker.

Actually it is kotlin issue. All the classes marked as @Serializable should be ignored for serialization. But, I didn't do that. I couldn't understand why should we ignore the classes in proguard.

@akhilsreekar I guess you can just use @SerialName for fields and still minify those classes, same as it was with Gson:

@Serializable
data class NetworkError(
    @SerialName("message")
    val error: String?
)