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
It might be connected https://github.com/gradle/gradle/issues/14211
What if the transitive dependency is in a library that cannot be updated?
I have the same issue, not sure how to solve it.
What if the transitive dependency is in a library that cannot be updated?
Then it's likely not compatible with Kotlin 1.4
If the previous version is in the transitive dependency, it still won't work with 1.4, so this is not a bug.
Regarding error message, I'm not sure that we have infrastructure to track and print whole dependency tree.
Getting same issue after updating kotlin-gradle-plugin to 1.4.0 does workaround exists?
@theromis Make sure that you do not have 0.20.0 version in your dependency tree via transitives
@sandwwraith already solved, in my case solution was just updating kotlin and ktor versions to set both to 1.4.0
but after solving this issue okhttp stopped work on api 19, think to fork ok http and comment out this line: https://github.com/square/okhttp/blob/master/okhttp/src/main/kotlin/okhttp3/internal/platform/AndroidPlatform.kt#L154
(because it works on 16, 17,18, 21...)
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?
@xjcl 1.0.0 API is different with 0.20.0. Also, 0.20.0 is not compatible with Kotlin 1.4
Most helpful comment
For anyone stumbling across this, in my case I resolved this by replacing
with
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?