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.

"kotlinx.serialization core version is too low" cumbersome message when previous version is present in transitive dependencies

See original GitHub issue

We have a lot of reports in slack with Your current kotlinx.serialization core version is too low, while current Kotlin compiler plugin 1.4.0 requires at least 1.0-M1-SNAPSHOT. Please update your kotlinx.serialization runtime dependency error message even though there is a direct dependency in the Gradle [1].

The root of the problem – the previous version is present in the transitive dependencies.

The proper solution would be to detect this transitivity and indicate it in the error message

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
xjclcommented, Sep 9, 2020

For anyone stumbling across this, in my case I resolved this by replacing

implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0" 

with

implementation "org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC"

in build.gradle.

Can someone illuminate me on what the difference is? If this is just a renaming, can we trigger some sort of IDE warning about this?

5reactions
iromeocommented, Dec 2, 2021

I get a similar error in the plugin for IntelliJ IDEA that depends on IntelliJ Platform SDK for version 2021.3, but not for 2021.2.x. Error message is: Your current kotlinx.serialization core version is too low, while current Kotlin compiler plugin 1.6.0 requires at least 1.0-M1-SNAPSHOT. Please update your kotlinx.serialization runtime dependency. error.

Could be reproduced using recommended IntelliJ plugin template (https://github.com/JetBrains/intellij-platform-plugin-template)

My minimal intellij plugin test case: kotlinx_issue.tar.gz

If you change platformVersion in gradle.properties to 2021.2.3 - everyting is ok, but with 2021.3 compilation error.


The plugin uses kotlinx serialization library 1.3.1 and kotlin 1.6.0

# build.gradle.kts

plugins {
    // Java support
    id("java")
    // Kotlin support
    id("org.jetbrains.kotlin.jvm") version "1.6.0"
    id("org.jetbrains.kotlin.plugin.serialization") version "1.6.0"
   ...
}
dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.1")
}
...

I assume this is caused by the difference dependencies that come from IntelliJ Platform SDK:

  • 2021.2.3: JAR files with version info:
.idea_distrib_cache/ideaIC-2021.2.3/lib/kotlinx-serialization-core-jvm-1.1.0.jar
.idea_distrib_cache/ideaIC-2021.2.3/lib/kotlinx-serialization-json-jvm-1.1.0.jar
.idea_distrib_cache/ideaIC-2021.2.3/lib/kotlinx-coroutines-jdk8.jar
  • 2021.3: Kotlin coroutines, datetime, serialization JAR files merged into a single file, w/o version info:
ideaIC-2021.3/lib/kotlinx.jar

Update: In my case several kotlinx libraries were repackaged in IntellliJ Platfrom SDK, 2021.3, but META-INF/MANIFEST.MF file is missing, so the compiler fails to detect what kotlinx implementation api is used (stored as a property manifest file, e.g. Implementation-Version: 1.1.0). In future sdk versions this will be fixed.

As a temporary workaround: Disable the error message from compiler using @Suppress("PROVIDED_RUNTIME_TOO_LOW") before every @Serializable, e.g.:

    @Suppress("PROVIDED_RUNTIME_TOO_LOW")
    @Serializable
    data class WrapperInfo(
    ...
    )
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Error in kotlinx-serialization w/ Retrofit 2
Your current kotlinx.serialization core version is too low, while current Kotlin compiler plugin 1.4.21 requires at least 1.0-M1-SNAPSHOT.
Read more >
Spring Boot Reference Documentation
Instructions for how to upgrade from earlier versions of Spring Boot are provided on the project wiki. Follow the links in the release...
Read more >
InvalidFragmentVersionForActivit...
I'm sorry for the previous message, the issue was caused by the dependency configuration of our project (some modules had a transitive dependency...
Read more >
Serialization: New player has joined
With the release of Kotlin 1.4 we got a new treat; kotlinx.serialization. A new tool to help us with the cumbersome task of...
Read more >
System requirements for 200.0 | ArcGIS Maps SDK for Kotlin
ArcGIS Maps SDK for Kotlin transitive dependencies ; kotlinx-coroutines-core, 1.6.0, runtime ; kotlinx-coroutines-android, 1.6.0, runtime ; kotlinx-serialization- ...
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