Thread
#multiplatform
    r

    ribesg

    3 years ago
    Hi, we have a dependency problem with our iOS target
    The headers of the Framework produced by the MPP iOS App Project are invalid, they contain duplicated information
    g

    gonzooin

    3 years ago
    r

    ribesg

    3 years ago
    The MPP iOS App Project exports both projects A and B. Projects Y, A and B have
    kotlinx.serialization
    and
    ktor
    as dependencies.
    Dico

    Dico

    3 years ago
    I think this would be better asked in #kotlin-native
    s

    svyatoslav.scherbina

    3 years ago
    Will be fixed in 1.3.30
    r

    ribesg

    3 years ago
    @svyatoslav.scherbina is it fixed in the latest eap?
    s

    svyatoslav.scherbina

    3 years ago
    Yes. Btw, why do you find headers containing duplicated information?
    r

    ribesg

    3 years ago
    Well that’s the whole issue, and you just said it’s fixed, so I don’t understand your question
    XCode refuses to compile stating that the framework is invalid, and shows what @gonzooin screenshoted above when opening the header file of the Framework.
    s

    svyatoslav.scherbina

    3 years ago
    The compilation error from this screenshot is fixed in 1.3.30.
    r

    ribesg

    3 years ago
    Ok, thanks for the confirmation. We’ll start migration to 1.3.30 EAP then. Do you have an issue number we can follow?
    s

    svyatoslav.scherbina

    3 years ago
    Do you have an issue number we can follow?
    What do you mean?
    We’ll start migration to 1.3.30 EAP then
    Alternatively you can prevent exporting
    JsonPrimitive
    to framework headers and continue using 1.3.2*.
    r

    ribesg

    3 years ago
    I mean that this issue should have been reported somewhere like on https://youtrack.jetbrains.net/ but I can’t find it
    @svyatoslav.scherbina I can’t find any docs on how to prevent exporting something referenced by a library I export
    s

    svyatoslav.scherbina

    3 years ago
    Do you export
    kotlinx.serialization
    explicitly, like you do with project
    A
    ?
    r

    ribesg

    3 years ago
    We never explicitely export
    kotlinx.serialization
    ,
    ktor-client
    or any other lib
    We only
    export
    Projects X, A and B in the MPP iOS App Project, we don’t export any other lib. Just 3
    export
    calls
    We have
    kotlinx.serialization
    as a dependency of a lot of project but it’s never exported using the
    export
    function as the MPP iOS App Project is the only one creating a Framework
    @svyatoslav.scherbina so what should we do?
    s

    svyatoslav.scherbina

    3 years ago
    If you don’t use
    transitiveExport
    in Gradle, then
    JsonPrimitive
    class is exported because it is used in public API. Please inspect your header to locate public API which brings
    JsonPrimitive
    to the header.
    r

    ribesg

    3 years ago
    @svyatoslav.scherbina we’re exposing a
    val
    of type
    KotlinxSerializer.() -> Unit
    in an
    object
    . Would that cause
    JsonPrimitive
    to be exported somehow? It’s the only thing we found
    There is no direct reference to
    JsonPrimitive
    in any of those project, public or not
    s

    svyatoslav.scherbina

    3 years ago
    Please inspect your header instead of projects.
    r

    ribesg

    3 years ago
    Ok, we found it. We have a reference to
    Json
    is a public API, which references
    JsonElement
    , which references
    JsonPrimitive
    We will need this reference in the future but not right now, so I guess it’ll have to wait for 1.3.30