This line:
import kotlinx.coroutines.*
Gives me Unresolved reference: kotlinx
error.
My project creation process is very basic:
In Intellij Idea: New project -> Kotlin -> JVM
My project structure:
Maybe I need to configure something somewhere?
SOLUTION:
I was creating my Kotlin app the wrong way. Finally I followed this tutorial: https://huongdankotlin.com/create-a-new-gradle-project-with-kolin-using-intellij.html
Then on kotlin (in src folder) -> new package -> kotlin file.
And then add implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.5.2")
inside dependencies
in the build.gradle.kts
Now it worked for me.
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.5.2")
insidedependencies
in thebuild.gradle.kts
file and sync your project. – Guano