Thread
#serialization
    r

    ribesg

    2 months ago
    What is this?
    java.lang.VerifyError: class kotlinx.serialization.json.internal.StreamingJsonDecoder overrides final method kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(Lkotlinx/serialization/descriptors/SerialDescriptor;ILkotlinx/serialization/DeserializationStrategy;Ljava/lang/Object;)Ljava/lang/Object;
    p

    Petter Måhlén

    2 months ago
    could it be a version mismatch between
    kotlinx-serialization-core
    and
    kotlinx-serialization-json
    ?
    r

    ribesg

    2 months ago
    Maybe. I get this crash in a script which depends on a kmp lib. The kmp lib has this dependency, among others.
    "commonMainApi"("org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}")
    Maybe explicitly adding the dependency on
    core
    too can help, I’ll try it
    A bad version of
    core
    could be imported as a transitive dependency of another dependency like ktor or something
    That doesn’t seem to work
    It started from a version that had a few changes, but one of them is adding dependency to ktor resources plugin so maybe it’s a transitive dependency of that
    "commonMainApi"("io.ktor:ktor-client-resources:${Versions.ktor}")
    I fixed it by adding this
    "commonMainApi"("org.jetbrains.kotlinx:kotlinx-serialization-core:${Versions.serialization}")
    and tweaking the dependency on
    ktor-client-resources
    "commonMainApi"("io.ktor:ktor-client-resources:${Versions.ktor}") {
        exclude("org.jetbrains.kotlinx", "kotlinx-serialization-core")
    }