https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

Rita Curado

09/11/2020, 5:25 PM
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

streetsofboston

09/11/2020, 5:31 PM
Remove the
-native
part. That is now all handled by the meta-data in
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9
r

Rita Curado

09/11/2020, 5:32 PM
ok thanks 🙂
Did this one changed as well
org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.9
?
s

streetsofboston

09/11/2020, 5:38 PM
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

Rita Curado

09/11/2020, 5:40 PM
ok, I will have a look at it, thanks anyway
l

louiscad

09/11/2020, 8:35 PM
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
3 Views