You should add the coordinates of the coroutines library in the
dependencies { ... }
block. Something like:
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
testImplementation(kotlin("test"))
}
If you look it up, you will find the kotlinx.coroutines repository, and there are instructions on how to add the dependency:
https://github.com/Kotlin/kotlinx.coroutines#gradle
(This is the case for any well-documented library)
This is where you can find the coordinates in the form
groupId:artifactId:version
. For coroutines 1.7.3, the coordinates are
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
. This is why we add the line
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
.