Hi everyone, what is the dependency that I should ...
# coroutines
r
Hi everyone, what is the dependency that I should use on Kotlin Multiplatform iosMain for coroutines? (compliant with the new 1.4.0 Kotlin version) I am getting this error:
Copy code
Could not find org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.9.
s
Remove the
-native
part. That is now all handled by the meta-data in
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9
r
ok thanks 🙂
Did this one changed as well
org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.9
?
s
And with kotlin1.4.x and the latest multi-platform gradle-plugin, just adding
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
in your
commonMain
only should suffice. The
iosMain
and
androidMain
should pick it up from
commonMain
automatically.
👍 2
Not sure if the test library has the proper meta-data….
I think the coroutine-test lib is still JVM only… not sure, though…
r
ok, I will have a look at it, thanks anyway
l
Also, you might want to use the 1.3.9-native-mt version if doing iOS stuff (so Dispatchers.Main, MainScope and withContext can work).
👍 2