In my Compose/Kotlin Multiplatform project, I have a
@Serializable
data class with
kotlin.uuid.Uuid
as one of its properties. I'm using Kotlin 2.0.21-RC and Kotlinx-Serialization 1.7.3, but I get the following compilation error:
Copy code
Serializer has not been found for type 'kotlin.uuid.Uuid'. To use context serializer as fallback, explicitly annotate type or property with @Contextual
While there is a serializer provided in the runtime, the kotlin plugin does not generate code using the serializer the until 2.1.0. you can either upgrade Kotlin or just contextual and setup the serializer in the serializer module
👍 1
a
Armond Avanes
10/03/2024, 7:52 PM
Thanks for the explanation and for your help. Upgrading to Kotlin 2.1.0-Beta1 fixed the problem! Now the code is fully compilable and working, although Android Studio LadyBug (2024.2.1) still shows them as error (serializer not found, etc).