k

    KamilH

    1 year ago
    Another issue: I’m working on a multiplatform library and I’m using both
    ktor 1.4.1
    and
    serialization 1.0.0
    . When I’m building and publishing it is works fine, but when I’m trying to use it in another project I’m getting a lot of “duplication” errors:
    Duplicate class kotlinx.serialization.BinaryFormat found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    I found some message that suggest to exclude it in a following way:
    implementation(io.ktor:ktor-client-serialization:1.4.1) {
        exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-runtime")
    }
    but it doesn’t help
    and so on
    Duplicate class kotlinx.serialization.BinaryFormat found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.DeserializationStrategy found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.InternalSerializationApi found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.KSerializer found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.MissingFieldException found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.Polymorphic found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.PolymorphicSerializer found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.PolymorphicSerializer$descriptor$1 found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.Required found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SealedClassSerializer found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SealedClassSerializer$$special$$inlined$groupingBy$1 found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SealedClassSerializer$descriptor$1 found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SealedClassSerializer$descriptor$1$elementDescriptor$1 found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerialFormat found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerialFormatKt found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerialInfo found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerialName found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.Serializable found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerializationException found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.SerializationStrategy found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    Duplicate class kotlinx.serialization.Serializer found in modules jetified-kotlinx-serialization-core-jvm-1.0.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.0.0) and jetified-kotlinx-serialization-runtime-0.20.0.jar (org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0)
    s

    sandwwraith

    1 year ago
    It looks like you have dependency that transitively includes old serialziation runtime
    k

    KamilH

    1 year ago
    Is there any possibility to get to know which one includes old serialization runtime?
    a

    araqnid

    1 year ago
    Did you solve this? You can use
    gradle dependencies
    to show the dependency graph, or you can do the exclusion at the configuration level rather than on a specific dependency
    k

    KamilH

    1 year ago
    Hi Steve, thank you for your comment. Actually I fixed it. It turned out that some library in the project to which I wanted to import my library to has been using
    serializations 0.2.0
    . When I updated that dependency, problem disappeared