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

Chetan Sachdeva

05/18/2020, 9:17 AM
Hi folks! I’m having a hard time setting up kotlin-mpp dependencies with ktor and kotlin-serialization. Is there a good example avaialable?
Android works fine but getting following error for iOS
Copy code
Task :SharedCode:compileKotlinIos FAILED
w: skipping /Users/chetan.sachdeva/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-runtime-iosx64/0.12.0/ef9382034100a3061405a45a9526a44b1c4b37b1/kotlinx-serialization-runtime.klib. The abi versions don't match. Expected '[17]', found '14'
w: The compiler versions don't match either. Expected '[]', found '1.3.50-release-11850'
e: Could not find "/Users/chetan.sachdeva/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-runtime-iosx64/0.12.0/ef9382034100a3061405a45a9526a44b1c4b37b1/kotlinx-serialization-runtime.klib" in [/Users/chetan.sachdeva/AndroidStudioProjects/OmHolisticJourney, /Users/chetan.sachdeva/.konan/klib, /Users/chetan.sachdeva/.konan/kotlin-native-macos-1.3.61/klib/common, /Users/chetan.sachdeva/.konan/kotlin-native-macos-1.3.61/klib/platform/ios_x64].
c

christophsturm

05/18/2020, 10:03 AM
r

rodolpho.couto

05/18/2020, 12:16 PM
I have a sample with Kotlin/Native: https://github.com/rodolphocouto/swapi-cli
r

russhwolf

05/18/2020, 12:28 PM
What versions of everything are you using? That error indicates a mismatch between library version and language version.
c

Chetan Sachdeva

05/18/2020, 12:31 PM
Thanks @christophsturm and @rodolpho.couto! @russhwolf I’m using following versions (same as kotlin-conf app):
Copy code
kotlin_version=1.3.70

# kotlin libraries
coroutines_version=1.3.1
ktor_version=1.3.0-beta-2
serialization_version=0.12.0

# android
gradle_android_version=3.5.0
r

russhwolf

05/18/2020, 12:36 PM
Yeah all your library versions are too old for 1.3.7x. Use coroutines 1.3.5 or 1.3.6, ktor 1.3.2, and serialization 0.20.0.
c

Chetan Sachdeva

05/18/2020, 12:38 PM
Great! I’ll try that. Thanks 🙂
Upgrading everything including gradle build version worked! Thanks everyone! 🙏
👍 1
3 Views