admin管理员组文章数量:1435297
I am using Kotlinx serialization in my KMP project.
This is the plugins section of the build.gradle file for shared module:
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
alias(libs.plugins.ksp)
alias(libs.plugins.room)
alias(libs.plugins.skie)
kotlin("plugin.serialization") version "2.0.20"
}
This is the gradle file for my androidApp:
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.pluginsposepiler)
id("kotlin-parcelize")
kotlin("plugin.serialization") version "2.0.20"
}
This is my project level gradle file:
plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.pluginsposepiler).apply(false)
kotlin("plugin.serialization") version "2.0.20"
}
When I run the app with minifyEnabled, I get this exception:
F4.h: Serializer for class 'a' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
As per the offical docs (.serialization), it says that nothing has to be added in proguard.
However, only when I add
-keep @kotlinx.serialization.Serializable class * {*;}
am I able to run the project with minifyEnabled true.
Why does the behavior seem different from what the docs say?
本文标签: androidIs there anything to do in proguard while using kotlinx serializationStack Overflow
版权声明:本文标题:android - Is there anything to do in proguard while using kotlinx serialization? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745640987a2667854.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论