How to start with Kotlin Coroutines? Tutorial <htt...
# coroutines
j
How to start with Kotlin Coroutines? Tutorial https://kotlinlang.org/docs/tutorials/coroutines-basic-jvm.html does not compile gradle script after modification under IntelJ IDEA 2017.3.2. Any ideas?
d
First, its a good idea to go through the guides on kotlinx.coroutines github repository...
g
What's your particular problem with Gradle?
j
After creating project with build.gradle.kts whole content of the file is red like here:

https://snag.gy/Akm20J.jpg

I also can't build project because of error:
Copy code
Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20-eap-33.
Searched in the following locations:
    <http://dl.bintray.com/kotlin/kotlin-eap-1.2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.20-eap-33/kotlin-gradle-plugin-1.2.20-eap-33.pom>
    <http://dl.bintray.com/kotlin/kotlin-eap-1.2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.20-eap-33/kotlin-gradle-plugin-1.2.20-eap-33.jar>
    <https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.20-eap-33/kotlin-gradle-plugin-1.2.20-eap-33.pom>
    <https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.20-eap-33/kotlin-gradle-plugin-1.2.20-eap-33.jar>
Required by:
    project :
d
@Jan Koprowski You could use regular groovy gradle... kotlin dsl is a whole new ballgame to get working... nothing to do with coroutines.
j
I need to add kotlinx.coroutines to project somehow and I can't using kotlin dsl. Fair another channel might be better to solve this particular problem.
d
#gradle, but do you really have to use gradle Kotlin DSL? Like I said, regular gradle should get you going much quicker, Kotlin DSL is still not 100% stable
j
Now I see it. Thank you for your hints 🙂
g
+1 to @dave08 @Jan Koprowski You can use Kotlin DSL but still has some tooling problems so experience may be not so smooth. Also, do you really want to use EAP version of Kotlin? I mean it’s fine but stable also works if you just want to try coroutines Actually you have this problem from error logs above because you should use repository with Early Access Programm builds
<http://dl.bintray.com/kotlin/kotlin-eap/>
instead of deprecated
<http://dl.bintray.com/kotlin/kotlin-eap-1.2/>
You can check this EAP release notes https://discuss.kotlinlang.org/t/kotlin-1-2-20-eap/5896
Also, if you want to try kotlin-dsl with gradle and coroutines, take a look on this example: https://github.com/gradle/kotlin-dsl/tree/master/samples/hello-coroutines
j
Thank You. Appreciate your help 🙂