Kotlin / kotlinx.serialization

Kotlin multiplatform / multi-format serialization
Apache License 2.0
5.43k stars 622 forks source link

MinifyEnabled = true strips away Serializable classes ? (Working project attached) #2861

Open mahmed1987 opened 16 hours ago

mahmed1987 commented 16 hours ago

I am attaching a working project in which the issue can be observed.

As per the documentation of this library , we are not to change add or modify the proguard files (if we are not using named companion objects).

That hasn't been my observation .

I am attaching a code sample to demonstrate the issue i obtain with minifyEnabled true. The project zip file is uploaded here.

Just open this project in android studio and run the android app on a device or simulator. The app would crash with the following stacktrace .

image

Adding -keep @kotlinx.serialization.Serializable class * {*;} to the proguard file would fix this situation , but this is against what the docs say

sandwwraith commented 6 hours ago

Why did you post it as a separate issue from #2858 though?

mahmed1987 commented 6 hours ago

hey @sandwwraith , I closed that issue because it didn't give satisfactory information in my opinion about the issue at hand .

So I created a sample project to demonstrate the issue and opened a new issue and closed that one .

In hindsight what I could have done is made this more clear by adding a comment on the previous issue between closing that , that I would be opening another issue with more details .

Would remain more vigilant moving forward