avro-kotlin / avro4k

Avro format support for Kotlin
Apache License 2.0
188 stars 36 forks source link

NoSuchMethodError #220

Open HalfLegend opened 3 weeks ago

HalfLegend commented 3 weeks ago

StackTrace:

java.lang.NoSuchMethodError: 'kotlinx.serialization.descriptors.SerialDescriptor kotlinx.serialization.descriptors.SerialDescriptorsKt.getNonNullOriginal(kotlinx.serialization.descriptors.SerialDescriptor)'
    at com.github.avrokotlin.avro4k.internal.schema.ValueVisitor.visitValue(ValueVisitor.kt:115)
    at com.github.avrokotlin.avro4k.Avro.schema(Avro.kt:64)
    at com.github.avrokotlin.avro4k.AvroKt.schema(Avro.kt:132)

Library version: implementation("com.github.avro-kotlin.avro4k:avro4k-core:2.0.0-RC2") kotlin version is: 2.0.0

Chuckame commented 3 weeks ago

As said in release notes https://github.com/avro-kotlin/avro4k/releases/tag/v2.0.0-RC2, you must have kotlinx-serialization-core 1.7.0-RC at least. Are you using another library like kotlinx-serialization-json or kotlinx-serialization-protobuf with an older version ?

HalfLegend commented 3 weeks ago

@Chuckame yes, I am using org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0-RC

HalfLegend commented 3 weeks ago

@Chuckame Gradle changed the version!!
In my build.grdle.kts file: api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0-RC")

But if I run "gradlew :{my-project}:dependencies" to check the actual version: org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0-RC -> 1.6.3

I am finding out the reason..

Chuckame commented 3 weeks ago

Can you paste your build.gradle?

Which version of the serialization plug-in are you using? 2.0.0 too?

Chuckame commented 2 weeks ago

Hello @HalfLegend, has it been fixed ?