question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash with Kotlin version 1.3.70

See original GitHub issue

Describe the bug

I was able to work well with Kotlin version 1.3.61 but now I am getting crash with Kotlin version 1.3.70

Caused by: java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Lkotlinx/serialization/internal/GeneratedSerializer;I)V in class Lkotlinx/serialization/internal/SerialClassDescImpl; or its super classes (declaration of 'kotlinx.serialization.internal.SerialClassDescImpl' appears in /path)

To Reproduce Create these classes:

@Serializable
data class PolygonResponse(
    val maxSpeed: Int?,
    val polygons: List<Polygons?>
)
@Serializable
data class Polygons(
    val baseCapacity: Int?,
    val distanceToPolygon: Int?,
    val polygon: List<Polygon?>
)
@Serializable(with = PolygonSerializer::class)
data class Polygon(
    val coordinates: List<Double>
)
internal object PolygonSerializer : KSerializer<Polygon> {

    private val serializer = ArrayListSerializer(Double.serializer())

    override val descriptor: SerialDescriptor = StringDescriptor.withName("Polygon")

    override fun serialize(encoder: Encoder, obj: Polygon) {
        encoder.encode(serializer, obj.coordinates)
    }

    override fun deserialize(decoder: Decoder): Polygon {
        return Polygon(decoder.decode(serializer))
    }
}

Expected behavior Serialization should work properly.

Environment

  • Kotlin version: [1.3.70]
  • Library version: [0.14.0]
  • Kotlin platforms: [JVM]
  • Gradle version: [6.2.1]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:32
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
qwwdfsadcommented, Mar 4, 2020

kotlinx-serialization depends heavily on the compiler version (on the plugin bundled into compiler, actually), 0.14.0 is not compatible with 1.3.70. We will release 0.20.0 today and think out how to improve diagnostics here

8reactions
sandwwraithcommented, Mar 4, 2020

Version 0.20.0, which is compatible with 1.3.70, is now published on JCenter and will be available on Maven Central soon. Check out the release notes: https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md#0200--2020-03-04

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin 1.3.70 Released - The JetBrains Blog
Today we're happy to present to you the latest version of Kotlin – 1.3.70. This incremental release doesn't provide any major new features....
Read more >
iOS app crashes on start when using Kotlin/Native framework ...
When trying to start iOS app with included Kotlin/Native framework it is crashing on start with log
Read more >
Kotlin version (@kotlin_version) / Twitter
Latest Kotlin version | kotlin.version@gmail.com ... update source documentation for the new default memory manager KT-53667 Compiler crashes on attempt t.
Read more >
Kotlin releases
For 1.3.70, we had 2 bug fix releases – 1.3.71 and 1.3.72. ... IntelliJ IDEA and Android Studio suggest updating to a new...
Read more >
For loop with Horizontal or Vertical Scroller Crashes ...
Version of Gradle: 6.4. Version of Kotlin: 1.3.70. OS: Arch Linux. Version of Compose: dev-11. Steps to Reproduce: Use the following code in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found