I am trying to learn Kotlin Flow. And when I try to add

import kotlinx.coroutines.flow.* it is not resolving.

你能看看我的依赖关系,帮我解决这个问题吗?

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.core:core-ktx:1.1.0'
ext.kotlin_version = '1.3.61'

Please help me to solve the issue.

推荐答案

From the document. Try to add the below dependence in to the build.gradle file(in the app level):

dependencies {
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2'
} 

Kotlin相关问答推荐

在Jetpack Compose中创建波浪式文本动画:顺序中断问题

KMP:未能添加cafe.adriel.voyager依赖项

如何将消费者放入 Kotlin 的 map 中?

如何在 kotlin 中创建自定义迭代器并添加到现有类?

通过顺序多米诺骨牌操作列表管理对象的最佳方法是什么?

如何在 jOOQ 中两次加入同一张表?

伴随对象在变量更改时更改它的值

T except one class

如何从kotlin中的ArrayList中删除所有元素

如何使用 Kotlin KClass 属性 simpleName 生成空值

比较 Kotlin 中的可比对象列表

如何使用Kotlin Dokka记录主构造函数参数

launch 仅从 Kotlin 1.3 开始可用,不能在 Kotlin 1.2 中使用

如何为kotlin异常生成SerialVersionId?

类型不匹配:推断类型为 LoginActivity 但应为 LifecycleOwner

未解决的参考 dagger 2 + kotlin + android gradle

判断EditText是否为空kotlin android

内联 Kotlin 方法没有覆盖报告

Kotlin var lazy init

目前不支持 Gradle 项目的自动库版本更新.请手动更新您的 build.gradle