https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
o

Orhan Tozan

03/02/2020, 4:48 PM
What needs to be put in the
jvmMain
sourceset for kotlin coroutines? Couldn't find anything at the README of the coroutines repo. Also, is there a reason why this doesn't come out-of-the-box? E.g. when I declare that I want to use kotlin coroutines in the project, it could automatically import the specific platform dependencies itself.
k

Kris Wong

03/02/2020, 5:07 PM
use
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutinesVersion")
in your common dependencies
o

Orhan Tozan

03/02/2020, 7:03 PM
So two kotlin coroutines dependencies?
k

Kris Wong

03/02/2020, 8:15 PM
1
o

Orhan Tozan

03/03/2020, 7:09 AM
Can you elaborate? What's the use of the coroutines-core-common dependency then, when would someone use that?
I actually added the normal core version to the jvm dependency, that worked
k

Kris Wong

03/03/2020, 1:53 PM
the common dependency is common-specific, and there are dependencies for each target as well.
native
is the gradle metadata dependency, so fills in the blanks for each target.
3 Views