martmists
07/07/2024, 8:24 PMkotlinx.serialization.SerializationException: Serializer for subclass 'MaterialAppTheme' is not found in the polymorphic scope of 'AppTheme'.
Check if class with serial name 'MaterialAppTheme' exists and serializer is registered in a corresponding SerializersModule.
To be registered automatically, class 'MaterialAppTheme' has to be '@Serializable', and the base class 'AppTheme' has to be sealed and '@Serializable'.
where MaterialAppTheme is an expect class
, with the @Serializable
on the actual class
declarations. I can't put the annotation on the expect class
because it doesn't have any properties in its primary constructor.Richard
07/08/2024, 5:01 AMRichard
07/08/2024, 5:05 AMMaterialAppTheme
then you can create another serializable class that has the same parameters but not extends anything and write a function to convert those.martmists
07/08/2024, 10:04 AM