Skolson5903
12/20/2021, 6:36 PMval json = Json { encodeDefaults = true }
val jsonString = json.encodeToString(JsonObject(jsonRow))
works fine in debug producing correct JSON. But release minified build gets this exception in the encodeToString call:
Serializer for class 'x' is not found.
Mark the class as @Serializable or provide the serializer explicitly.
k9.k: Serializer for class 'x' is not found.
Mark the class as @Serializable or provide the serializer explicitly.
What should I change to correct this? I have proguard rules set up for explicit @Serializable data classes and they work fine. But I have no rule(s) for this "dynamic" encode use case and am not sure what "class 'x'" is so don't know what rule to try. Is it saying that it can't find the serializer for Map (class 'x' minified), even though that is the explicit type required by the JsonObject constructor?
Any help/tips are appreciated, my searches for something like this are not finding good hits 🙂 This is serialization 1.3.1 and kotlin 1.6.10.ephemient
12/20/2021, 10:59 PMjson.encodeToString(JsonObject.serializer(), JsonObject(jsonRow))
Skolson5903
12/21/2021, 12:04 AM