What’s the proper way to make sure only single ver...
# serialization
k
What’s the proper way to make sure only single version of
kotlinx.serialization.json
is used? I’m having issues where an external library that I use leaks a different version of
kotlinx.serialization.json
from the one that I use and seems to cause IR lowering issue when compiling for K/N 🤔
👍 1
Specifically the error that I’m seeing is this:
Copy code
Caused by: org.jetbrains.kotlin.backend.common.CompilationException: Back-end: Please report this problem <https://kotl.in/issue>
/opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt:19:1
Problem with `@OptIn(markerClass = [ExperimentalSerializationApi::class, ExperimentalUnsignedTypes::class])
internal open class StreamingJsonDecoder : JsonDecoder, AbstractDecoder {
Either removing
kotlinx.serialization
from module, or adding my own
kotlinx.serialization.json
dep with explicit version seems to fix the issue
Still wondering if there’s some Gradle build configuration I should do to lock version of the
kotlinx.serialization.json
?
p
Here to wait for responses too. Having the same issue with other libraries. Tried the gradle resolution strategy API but has no effect. I wish some come up with some code snippet to select/force a specific version other than the explicit one
s
As far as I know, "adding my own kotlinx.serialization.json dep with explicit version" is a normal way in Gradle to lock the version.
p
Leonid, I try below snippet and it didn't work
Copy code
implementation("org.jetbrains.skiko:skiko") {
        version {
            strictly("0.7.68")
        }
    }
It kept downloading the version pointed by the compose-multiplatform plugin.