https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
h

Hristijan

02/27/2024, 8:32 PM
hey guys, anyone encountering this error on iOS?
Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Can not get instance of singleton 'Plugin': No class found for symbol 'io.ktor.client.plugins/HttpTimeout.Plugin|null[0]'
Copy code
ktor = "2.3.8"
t

tylerwilson

02/27/2024, 8:46 PM
Are you using Kotlin 1.9.22 or 2.0 Beta? I think I saw something similar when trying to use 2.0. Best to stick to 1.9.22 if you are not.
h

Hristijan

02/27/2024, 8:49 PM
Copy code
ktor = "3.0.0-beta-1"
i’ve had it fixed on other platforms using ktor beta, although not iOS btw i’m using kotlin = “1.9.22"
also for the shared commonMain i’m using
Copy code
val wasmVersion = "wasm2"
implementation("io.ktor:ktor-client-core:3.0.0-$wasmVersion")
implementation("io.ktor:ktor-client-logging:3.0.0-$wasmVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:3.0.0-$wasmVersion")
implementation("io.ktor:ktor-client-content-negotiation:3.0.0-$wasmVersion")

Maybe that's also a reason
since sometimes either i get the error above or this one
Copy code
> Task :shared:compileKotlinIosSimulatorArm64 FAILED
warning: skipping /Users/funkymuse/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-io-iossimulatorarm64/3.0.0-wasm2/65d3b0f04af93815fa5542f83b9e4e13f4f30e77/ktor-io-cinterop-mutex.klib. The library versions don't match. Expected '3.0.0-beta-1', found 'unspecified'
error: Could not find "io.ktor:ktor-io-cinterop-mutex" in [/Users/funkymuse/AndroidStudioProjects/InKotlin_mk_kmp_intro, /Users/funkymuse/.konan/klib, /Users/funkymuse/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.22/klib/common, /Users/funkymuse/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.22/klib/platform/ios_simulator_arm64]
error: Compilation finished with errors
d

Dima Avdeev

02/28/2024, 8:15 AM
You can also ask on #ktor channel
h

Hristijan

02/28/2024, 8:19 AM
I’ve fixed it, since in the common mains i was using wasm, i’ve added the darwin client to the same wasm version
14 Views