Like exception says the problem is that you haven't registered polymorphic serialization for your Foo class. Some time ago, I read an article describing a problem experienced with Kotlin objects and serialization using built-in Java methods. It may be any format like JSON, xml and it follows the protocol buffers. I've tried faffing with versions of things to see if that helps, but overall, no dice. The kotlin serialization is the technique and process used to convert the application data with the specified format, and that can be transferred across the network, and it will be stored in the database or the external file. Pattern All Implemented Interfaces: Serializable public final class. I was sort of expecting it to work, but I got the error above. Java Backend Development(Live) Android App Development with Kotlin(Live) Python. My kotlinx serialization is implementation(":kotlinx-serialization-json:1.4.0"),īut also have set kotlin("rialization") version "1.7.20" This is thrown from val tmp = Json.encodeToString(this)īut as far as I can tell, that's exactly what I have done? what have I done wrong? am I doing something overall stupid? I'm sort of stumped. Mark the base class as 'sealed' or register the serializer explicitly. Part 3 provides examples of cross-platform apps you can build and deploy, such as websites and services using ASP.NET Core or mobile apps using Xamarin.Forms. The issue I have, is when i get to aa.save(), I get : Class 'Foo' is not registered for polymorphic serialization in the scope of 'Bar'. performance, and working with the file system, async streams, serialization, and encryption. bundle. Hoping you might be able to help, as I'm slowly tearing my hair out and I'm not sure where I've gone wrong, but hope it might also be class Foo
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |