https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Diego

09/29/2020, 1:07 PM
Hello guys, I'm trying to configure a Kotlin multiplatform project with coroutines but the build fails with the following error:
Copy code
> Task :compileKotlinIosArm64 FAILED
w: skipping /Users/XXX/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosarm64/1.3.8/ab1f410af27e33b328b0e7b3b75875953822e9eb/kotlinx-coroutines-core.klib. The abi versions don't match. Expected '[17]', found '22'
w: The compiler versions don't match either. Expected '[]', found '1.3.71-release'
e: Could not find "/Users/XXX/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosarm64/1.3.8/ab1f410af27e33b328b0e7b3b75875953822e9eb/kotlinx-coroutines-core.klib" in [/Users/XXX/Documents/Development/kotlin-multiplatform-spike/common, /Users/XXX/.konan/klib, /Users/XXX/.konan/kotlin-native-macos-1.3.61/klib/common, /Users/XXX/.konan/kotlin-native-macos-1.3.61/klib/platform/ios_arm64].
Below my build.gradle file
Copy code
import org.jetbrains.kotlin.gradle.tasks.*

plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
}
repositories {
    mavenCentral()
    jcenter()
}
group 'com.kotlin.common'
version '0.0.1'

apply plugin: 'maven-publish'

kotlin {
    jvm()
    def iosFrameworkName = "KiplingCommon"
    def iOSTargetConfig = {
        binaries.framework {
            baseName = "$iosFrameworkName"
        }
    }
    iosX64("iosX64", iOSTargetConfig)
    iosArm64("iosArm64", iOSTargetConfig)
    sourceSets {
        commonMain.dependencies {
            implementation kotlin('stdlib-common')
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.8"
        }
        commonTest.dependencies {
            implementation kotlin('test-common')
            implementation kotlin('test-annotations-common')
        }
        jvmMain.dependencies {
            implementation kotlin('stdlib-jdk8')
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.8"
        }
        jvmTest.dependencies {
            implementation kotlin('test')
            implementation kotlin('test-junit')
        }
        iosMain {
            dependsOn(commonMain)
            iosX64Main.dependsOn(it)
            iosArm64Main.dependsOn(it)
            dependencies {
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.8"
            }
        }
        iosTest {}
    }
}
Any idea about why I receive that error and how to fix the problem. Thanks in advance!
m

mbonnin

09/29/2020, 1:08 PM
Bump your Kotlin version
Looks like
coroutines:1.3.8
is compiled for
1.3.72
, which I would expect to be compatible with
1.3.61
but maybe it's not
Until the Kotlin native ABI is stable, all your dependencies need to be compiled with a version of kotlin compatible with the Kotlin version of your project
d

Diego

09/29/2020, 1:16 PM
These incompatibilities between versions are so confusing and time consuming 😭 I just want to setup the project and start coding
I'm using the same versions of kotlin and coroutines used in the
kotlinconf-app
. I'm able to build with no problems that app but no my sample app
m

mbonnin

09/29/2020, 1:18 PM
Yea, it's a bummer... I don't think there's a silver bullet there unfortunately. Your best bet is certainly to update everything to Kotlin
1.4.10
I'd recommend looking at https://github.com/joreilly/PeopleInSpace, it's generally more up-to-date
🙌 1
1.3.61 is pretty old in terms of multiplatforms
d

Diego

09/29/2020, 1:20 PM
Thank you Martin. I'm going to have a look at that project 🙂
👍 1
2 Views