I have a KMM library that use kotlinx.serializatio...
# serialization
a
I have a KMM library that use kotlinx.serialization for serialization. Some Android application has a dependency to my library and it has an issue with proguard. This app has
minifyEnabled = true
and therefore some of my data classes are removed by proguard. I was able to resolve that by adding a proguard rule to keep this classes, but it did work only when I apply this rule on the app side. Wonder if it is even possible to have this rules on the library side so that app would not need to modify their proguard rules
You could also use. https://developer.android.com/reference/androidx/annotation/Keep But you would need to use an expect/actual to provide a version of Kotlin Native.
a
Much appreciate it @mkrussel . Second option could be a good one, but at the moment I have some limitations on using
androidx
libraries family. Definitely, going to take a look into first option.
e
Use consumer proguard rules for the library
1
a
That is what I did and that works fine for me.