avro-kotlin / avro4k

Avro format support for Kotlin
Apache License 2.0
198 stars 37 forks source link

NoSuchMethodError #220

Closed HalfLegend closed 4 months ago

HalfLegend commented 5 months 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 5 months 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 5 months ago

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

HalfLegend commented 5 months 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 5 months ago

Can you paste your build.gradle?

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

Chuckame commented 5 months ago

Hello @HalfLegend, has it been fixed ?

Chuckame commented 4 months ago

Closing it as there isn't any news