Sorry.I use " import kotlinx.coroutines.async" to replace " import kotlinx.coroutines.experimental.async",but Android Studio prompts error.How should I do?
You need to provide a coroutine-scope. Either you class needs to implement the interface CoroutineScope, or you need to have one from another call and use myCoroutineScope.async { ... }.
I believe this is different from the experimental coroutines.
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
// for android you may also need this, there are also similar libraries for JavaFX and Swing.
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1"