Emre
09/09/2025, 10:13 PMInstantSerialized::class.java because I use kotlin.time.Instant in a data class but I can't because InstantSerialized is private. I did not have this problem with kotlinx-datetime.Dmitry Khalanskiy [JB]
09/11/2025, 9:47 AMInstantSerialized is used when Instant gets serialized by Java serialization. kotlinx.datetime.Instant didn't implement java.io.Serializable, so it was impossible to serialize it directly in Java, you had to add some adapter (like this one: https://github.com/Kotlin/kotlinx-datetime/issues/143#issuecomment-975380754). Somehow, adding Java serialization support to Instant broke your use case. Did you use such an adapter before, with kotlinx-datetime? If so, it may be necessary to get back to doing that.Emre
09/11/2025, 12:54 PMDmitry Khalanskiy [JB]
09/11/2025, 12:55 PMkotlinx.serialization.Emre
09/11/2025, 1:04 PMDmitry Khalanskiy [JB]
09/11/2025, 1:08 PMkotlinx.serialization is a Kotlin-specific serialization mechanism that works on the JVM + JS + Native + Wasm. java.io.Serializable is the standard serialization mechanism available in all JVM languages, but only on them. These two mechanisms are completely separate and incompatible. We recommend using kotlinx.serialization, as it solves some of the pitfalls of Java serialization, but Java serialization is still occasionally necessary even in Kotlin code when a language-agnostic JVM framework or library demands it.