I want to use coroutines from my Kotlin/Native pro...
# kotlin-native
m
I want to use coroutines from my Kotlin/Native project, I understand I need to add the
kotlinx-coroutines-core-native
dependency, but I am not sure how to do that. The
build.gradle
file Idea generated for me along with the project does not have a
dependencies
section, and if I create my own I get an error
Could not find method implementation()
when running Gradle sync. What's the correct way to add the dependency? I looked at the Kotlin/Native coroutines example project and it does not have the dependency in it's
build.gradle
so I'm not sure how it works. This is probably a stupid issue but I can't find any information on using coroutines in Kotlin/Native, except in the context of mobile development and compatibility with iOS, while my project is just a plain simple command line program.
n
Not sure what platform you want to target but the build file should point you in the right direction.
Can be very annoying at times to see many parts of the Kotlin Native documentation only cover mobile development. JB should extend the Kotlin Native documentation to cover other areas of sw development like Linux, server, and IoT for example.
At times it seems there is too much focus with Kotlin Native on the mobile development side to the detriment of other sw development areas (especially Linux which is being neglected, refer to Which platforms do you target? question - https://www.jetbrains.com/lp/devecosystem-2019/kotlin/ ) ☹️.
m
@napperley Thank you, it seems that build file would have worked, but there is actually no version of the coroutines dependency for the ARM architecture. I am developing an electronics/IoT project running on a Raspberry Pi, which uses ARM. Guess I just can't have coroutines. 😕
n
Bit of a pity there are no coroutines for ARM v7, however there is an issue for it: https://github.com/Kotlin/kotlinx.coroutines/issues/855
m
I see it's not a particularly active issue, oh well.