FunkyMuse
12/12/2021, 6:54 PMephemient
12/12/2021, 7:37 PMinline fun <reified T> encodeToString(value: T)
) and stick to encodeToString(MyClass.serializer(), value)
it should already work without ProGuard rulesephemient
12/12/2021, 7:38 PMephemient
12/12/2021, 7:41 PMFunkyMuse
12/12/2021, 8:35 PM@Serializable
data class MetaModel(
@SerialName("current_page")
val currentPage: Int?,
@SerialName("last_page")
val lastPage: Int?,
@SerialName("per_page")
val perPage: String?,
@SerialName("total")
val total: Int?
)
I do it like this all the time, all my classes are annotated with serial names and serializable, but still it fails without proguard rule, is there a way to somehow circumvent adding proguard rules for this way?ephemient
12/12/2021, 10:05 PMFunkyMuse
12/12/2021, 10:38 PMephemient
12/12/2021, 11:08 PMephemient
12/12/2021, 11:08 PMMetaModel.serializer()
it should work. if you're relying on anything doing reflection to obtain the serializer, you will need proguard rules.FunkyMuse
12/13/2021, 12:57 AMephemient
12/13/2021, 1:02 AMserializersModule.serializer(type)
to get the serializer, so it's effectively reflecting at runtimeephemient
12/13/2021, 1:09 AM