https://kotlinlang.org logo
Title
j

Jan Koprowski

01/06/2018, 9:40 PM
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

dave08

01/07/2018, 3:19 AM
First, its a good idea to go through the guides on kotlinx.coroutines github repository...
j

Jan Koprowski

01/07/2018, 12:05 PM
Thank You. Maven configuration worked. Gradle configuration still does not work but I can at least start with something 🙂
g

gildor

01/07/2018, 1:05 PM
What's your particular problem with Gradle?
j

Jan Koprowski

01/07/2018, 1:29 PM
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:
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

dave08

01/07/2018, 1:34 PM
@Jan Koprowski You could use regular groovy gradle... kotlin dsl is a whole new ballgame to get working... nothing to do with coroutines.
j

Jan Koprowski

01/07/2018, 1:37 PM
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

dave08

01/07/2018, 1:39 PM
#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

Jan Koprowski

01/07/2018, 2:08 PM
Now I see it. Thank you for your hints 🙂
g

gildor

01/08/2018, 1:23 AM
+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

Jan Koprowski

01/09/2018, 11:22 AM
Thank You. Appreciate your help 🙂