Thread
#multiplatform
    tylerwilson

    tylerwilson

    1 year ago
    Ugh, this is frustrating! I am trying to update to latest Ktor, serialization and/or coroutines in my shared KMM module. This combo works:
    val kotlinVersion = "1.5.21"
    val coroutinesVersion = "1.5.0-native-mt"
    val ktorVersion = "1.6.1"
    val serializationVersion = "1.2.1"
    if i try to update any of them (1.5.1-native-mt, 1.6.2 or 1.2.2), then the linkDebugFrame taks will either fail silently (create an empty klib folder) or spit out the error below, depending on the target (I have it set up for android, jvm, ios, watchos and macos). Using latest AS Arctic Fox with latet Kotlin 1.5.21 plugin.
    w: skipping /Users/tylerwilson/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-serialization-iosx64/1.6.2/681f93a891846267e5050007bc41a01e459dbe74/ktor-client-serialization.klib. Incompatible abi version. The current default is '1.4.2', found '1.5.0'. The library produced by 1.5.20 compiler
    e: Could not find "/Users/tylerwilson/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-serialization-iosx64/1.6.2/681f93a891846267e5050007bc41a01e459dbe74/ktor-client-serialization.klib" in [/Users/tylerwilson/Projects/salonbiz-stylist-android, /Users/tylerwilson/.konan/klib, /Users/tylerwilson/.konan/kotlin-native-prebuilt-macos-1.5.10/klib/common, /Users/tylerwilson/.konan/kotlin-native-prebuilt-macos-1.5.10/klib/platform/ios_x64]
    Can anybody help????
    russhwolf

    russhwolf

    1 year ago
    It's looking in
    ~/.konan/kotlin-native-prebuilt-macos-1.5.10
    so make sure you actually are using kotlin 1.5.21.
    tylerwilson

    tylerwilson

    1 year ago
    Yes, I saw that too. But it works when I use the versions shown above. I do have the 1.5.21 plugin, and I have this block in settings:
    resolutionStrategy {
            eachPlugin {
                if (requested.id.namespace == "com.android") {
                    useModule("com.android.tools.build:gradle:7.0.0")
                }
                when (requested.id.id) {
                    "kotlin-multiplatform", "org.jetbrains.kotlin.multiplatform", "org.jetbrains.kotlin.native.cocoapods" ->
                        useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
                    "kotlinx-serialization", "org.jetbrains.kotlin.plugin.serialization" ->
                        useModule("org.jetbrains.kotlin:kotlin-serialization:1.5.21")
                }
            }
        }
    and this block in build:
    plugins {
        id("com.android.library") //version "4.2.2"
        kotlin("multiplatform") //version "1.5.21"
        //kotlin("native.cocoapods")
        kotlin("plugin.serialization") //version "1.5.21"
        id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3"
    }
    note the versions are commented out since that then breaks everything.
    russhwolf

    russhwolf

    1 year ago
    Yeah that seems weird, then. What happens if you remove the multiplatform-swiftpackage plugin? I don't know what that's built with off-hand so maybe it's pulling in an older version somehow.
    tylerwilson

    tylerwilson

    1 year ago
    I renamed that .konan 1.5.10 dir and it then downloaded it again. This lib is included in an app project that is using 1.5.10 (it uses Compose, and so has to be). Perhaps gradle is somehow looking in that project somehow. I am running :library:link… so I would not expect. Testing it by changing that kotlin version temporarily
    I really do not gradle…
    Maybe it is AS getting involved somehow. Changing the app level kotlin version appears to have worked. Will continue testing…
    So close. So the individual bits build, now but when I try the XCFramework task, it fails (after 15 minutes of build time [mostly linking[) with this issue https://github.com/ge-org/multiplatform-swiftpackage/issues/36