Do we need to import kotlinx-coroutines-android de...
# android
s
Do we need to import kotlinx-coroutines-android dependencies to use coroutines with kotlin? Kotlin has it’s own coroutines implementations right? What’s the diference between the two?
b
The Android coroutine library defines
Dispatchers.Main
and also has some helper functions with
Handler
. Really, you only need to define the Android library, as it also brings in the base coroutine library.
s
ok cool. I was using coroutines without the import and everything was fine
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
*without
s
There’s some considerations to make for multiplatform projects that leverage coroutines, but maybe not relevant to your project 👍
b
Ah, yeah. If you are going MPP, you'll want to bring in the base library for the common code.
a
@Scott Kruse like what?