Hi everyone. My problem is <Dispatchers.IO> is mis...
# multiplatform
b
Hi everyone. My problem is Dispatchers.IO is missing in compose multiplatform project. I have coroutine core dependency in common.main. Have anyone encountered this? Appreciate any help.
Copy code
kotlinxCoroutinesCore = "1.8.1-Beta"                                                      kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" }
s
Depends on your targets, whether you have Dispatchers.IO or not. But IIRC, Dispatchers.Default is available in KMP.
b
Didn't know it depends on targets, because i am pretty sure i used it previous project which targets only android and iOS. And yes Dispatchers.Default is available, thanks.
e
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-i-o.html is only provided in the "concurrent" source set, which is set up to be a parent of JVM and Native. JS and WASM do not have concurrency.
(I'm not sure if that's documented anywhere outside of the kotlinx.coroutines sources though, https://github.com/Kotlin/kotlinx.coroutines/blob/1.8.1/kotlinx-coroutines-core/build.gradle.kts#L20-L34)
b
Thank you both thank you color