-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MinifyEnabled = true strips away Serializable objects #2861
Comments
Why did you post it as a separate issue from #2858 though? |
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 |
It seems there are some problems in the connection between serializable objects and R8 full mode. This code: @Serializable
class Klas
@Serializable
object Obj
println(serializer(typeOf<Klas>()))
println(serializer(typeOf<Obj>())) prints
when R8 full mode is disabled, and throws
when R8 full mode is enabled (which is the default for recent versions of AGP). To workaround this, you can either disable full mode ( Tested on
|
@sandwwraith I would raise the issue on android issue tracker channel too I too believe this must be something to do with the navigation library |
@mahmed1987
This is a stricter rule compared to |
Related R8 issue https://issuetracker.google.com/issues/379996140 |
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 .
Adding
-keep @kotlinx.serialization.Serializable class * {*;}
to the proguard file would fix this situation , but this is against what the docs sayThe text was updated successfully, but these errors were encountered: