Search code examples
android-studiogradlekotlincompiler-errorskotlinx.coroutines

Compilation error: "-Xcoroutines has no effect: coroutines are enabled anyway in 1.3 and beyond"


When I try to compile my Android app written in Kotlin, I get the following compilation error, and my build fails:

w: -Xcoroutines has no effect: coroutines are enabled anyway in 1.3 and beyond

How can I fix this?


Solution

  • It turns out it is actually very easy to solve this problem, and I thought I'd document my solution for people who will undoubtedly stumble upon the same problem in the future.

    Simply remove the following block from your app-level build.gradle, hit "Sync Now" in Android Studio and rebuild:

    kotlin {
        experimental {
            coroutines "enable"
        }
    }