Hi, I’m attempting to upgrade a project to Kotlin ...
# kotlin-native
v
Hi, I’m attempting to upgrade a project to Kotlin 1.9.21 and I’m getting error in a dependency that uses cinterop. My versions: Kotlin - 1.9.21 Compose Multiplatform - 1.5.11 Atomicfu - 0.23.1 I read that similar problem was fixed in kotlin 1.9.21 and Atomicfu 0.23.1 but I already getting error in compileKotlinIosSimulatorArm64 task
Copy code
> Task :commonModule:compileKotlinIosSimulatorArm64 FAILED
w: skipping /Users/vladimirmalykhin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iossimulatorarm64/0.23.1/577e14084dac4dbadcaf86db01f359b4939f5d5a/atomicfu-cinterop-interop.klib. The library versions don't match. Expected '0.23.0', found 'unspecified'
e: Could not find "org.jetbrains.kotlinx:atomicfu-cinterop-interop" in [/Users/vladimirmalykhin/AP/wowKMM, /Users/vladimirmalykhin/.konan/klib, /Users/vladimirmalykhin/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/common, /Users/vladimirmalykhin/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/platform/ios_simulator_arm64]
How to fixing this?
p
have you tried clearing the cahces and retrying again? https://github.com/Kotlin/kotlinx-atomicfu/issues/365
I had the same or similar issue as well but it worked fine in the past weeks. (when i was using kotlin 1.9.21 and now kotlin 1.9.22) https://kotlinlang.slack.com/archives/C3SGXARS6/p1699031082776689
v
Problem in kotlin 1.9.22 that it not worked with lates version Compose Multiplatform 1.5.11
invalidate caches not helped it is search correct library version atomicfu
Copy code
caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iossimulatorarm64/0.23.1/5
but in task commonModule:compileKotlinIosSimulatorArm64 I had error maybe impotant up build gradle version - my current version is 8.1.2
p
Have you tried adding an explicit dependency on "org.jetbrains.kotlinxatomicfu0.23.1" to commonModule.commonMain or commonModule.iosMain? That may work around the issue.
v
I added an explicit dependency on “org.jetbrains.kotlinatomicfun0.23.1” to common Module.common Main
p
Problem in kotlin 1.9.22 that it not worked with lates version Compose Multiplatform 1.5.11
It would work with kotlin 1.9.22 if you used the jetpack compose compiler version 1.5.7.1.
Copy code
compose {
    kotlinCompilerPlugin.set(libs.compose.compiler.jetbrains.orNull?.toString())
}
libs.version.toml
Copy code
[versions]
compose-compiler-jetbrains = "1.5.7.1"

[libraries]
compose-compiler-jetbrains = { group = "org.jetbrains.compose.compiler", name = "compiler", version.ref = "compose-compiler-jetbrains" }
Or just like this if you're not using a version catalog:
Copy code
compose {
    kotlinCompilerPlugin.set("org.jetbrains.compose.compiler:compiler:1.5.7.1")
}
atomicfun != atomicfu
v
o sorry atomicfu
p
and org.jetbrains.kotlin != org.jetbrains.kotlinx - but i see what you meant
v
not “fun”
😁 1
p
If even an explicit dependency doesn't fix it I don't know what would help, sorry.
v
add kotlin 1.9.22 add explixt depency kotlinCompilerPlugin.set(“org.jetbrains.compose.compilercompiler1.5.7.1”) in common main stay implementation(“org.jetbrains.kotlinxatomicfu0.23.1") invalidate cahshe and…..
Task commonModulecompileKotlinIosSimulatorArm64 FAILED
w: skipping /Users/vladimirmalykhin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iossimulatorarm64/0.23.1/577e14084dac4dbadcaf86db01f359b4939f5d5a/atomicfu-cinterop-interop.klib. The library versions don’t match. Expected ‘0.23.0’, found ‘unspecified’ e: Could not find “org.jetbrains.kotlinx:atomicfu-cinterop-interop” in [/Users/vladimirmalykhin/AP/wowKMM, /Users/vladimirmalykhin/.konan/klib, /Users/vladimirmalykhin/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.22/klib/common, /Users/vladimirmalykhin/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.22/klib/platform/ios_simulator_arm64]
p
That's strange, it expects '0.23.0', not even '0.23.1' so there seems to be a reference to 0.23.0 somewhere on the classpath. have you tried that workaround that was mentioned in that other thread? https://github.com/cashapp/zipline/blob/trunk/build.gradle.kts#L242-L251
v
yes, sure, but not helped(
This may be due to the fact that my build machine it is MacOs 13 version?