Kotlinx.coroutines: Keep getting this warning : w: -Xcoroutines has no effect: coroutines are enabled anyway in 1.3 and beyond

Created on 24 Oct 2018  路  1Comment  路  Source: Kotlin/kotlinx.coroutines

Hi,

i just migrated to : settings

**Project Gradle configs**

//SDK & TOOLS
COMPILE_SDK_VERSION  = 28
MIN_SDK_VERSION      = 21
TARGET_SDK_VERSION   = 28

**KOTLIN_VERSION**        = '1.3.0-rc-190' //''1.2.71'
**COROUTINES_VERSION**    = '0.30.2-eap13' //''0.26.1' // '1.0.0-RC1' --< everything looses it's mind

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"

maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }

Module Gradle configs

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.KOTLIN_VERSION"
    implementation "androidx.core:core-ktx:$rootProject.KTX_VERSION"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.COROUTINES_VERSION"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.COROUTINES_VERSION"

Gradle properties

kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true

Android Studio Plugin configs
Early Access Preview 1.3
current Kotlin plugin version : 1.3.0-rc-190-Studio3.3-1

Getting compiler warning:

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

image

the other warning can't even fit in the window and i can't see it .

question

Most helpful comment

You probably have something like

kotlin {
    experimental {
        coroutines "enable"
    }
}

in your build script.

In Kotlin 1.2 you should have explicitly opt-in or coroutines because it was an experimental feature.
In Kotlin 1.3 it is already production quality feature and such opt-in is no longer required, that's exactly what compiler is trying to tell you.
Just remove coroutines "enable" from your buildscript.

>All comments

You probably have something like

kotlin {
    experimental {
        coroutines "enable"
    }
}

in your build script.

In Kotlin 1.2 you should have explicitly opt-in or coroutines because it was an experimental feature.
In Kotlin 1.3 it is already production quality feature and such opt-in is no longer required, that's exactly what compiler is trying to tell you.
Just remove coroutines "enable" from your buildscript.

Was this page helpful?
0 / 5 - 0 ratings