Daniele B
08/31/2020, 3:15 PMandroidMain
has org.jetbrains.kotlinx:kotlinx-coroutines-android
, but in my project it seems to compile also without specifying it.
However it doesn’t compile if from androidMain
I remove io.ktor:ktor-client-android
.
Can anyone give an explanation?
Is there a reason why Ktor requires the android-specific library and coroutines doesn’t?russhwolf
08/31/2020, 4:11 PMkotlinx-coroutines-android
just has the Android implementation of Dispatchers.Main
and some related utilities. If you don't have it you'll probably fail at runtime when you try to access that dispatcher.Daniele B
08/31/2020, 5:39 PM