Trying to run some examples for Kotlin coroutines, but can\'t build my project. I\'m using the latest gradle release - 4.1
Any suggestions what to check/fix?
Her
Launch isn't used anymore directly. The Kotlin documentation suggests using:
fun main() {
GlobalScope.launch { // launch a new coroutine in background and continue
delay(1000L)
println("World!")
}
println("Hello,") // main thread continues here immediately
runBlocking { // but this expression blocks the main thread
delay(2000L) // ... while we delay for 2 seconds to keep JVM alive
}
}