Thread
#serialization
    r

    rnentjes

    1 year ago
    Anyone run into this one yet?:
    java.lang.NoSuchMethodError: kotlinx.serialization.internal.AbstractPolymorphicSerializer.findPolymorphicSerializerOrNull(Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)Lkotlinx/serialization/SerializationStrategy;
    	at kotlinx.serialization.PolymorphicSerializerKt.findPolymorphicSerializer(PolymorphicSerializer.kt:96)
    	at kotlinx.serialization.json.internal.PolymorphicKt.findActualSerializer(Polymorphic.kt:29)
    	at kotlinx.serialization.json.internal.PolymorphicKt.access$findActualSerializer(Polymorphic.kt:1)
    	at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:226)
    	at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:81)
    	at kotlinx.serialization.internal.MapLikeSerializer.serialize(CollectionSerializers.kt:123)
    	at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:223)
    	at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.kt:81)
    This is KMM with serialization plugin 1.4.10 and dependency 'kotlinx-serialization-json:1.0.0' in common. The error happens on the jvm with a sealed class.
    s

    sandwwraith

    1 year ago
    maybe you have old version (1.0.0-RC or 0.20.0) included somewhere in the classpath
    r

    rnentjes

    1 year ago
    Thx, you are right, there was another version included through a ktor dependency.