当 dao 设置为 return 时找不到符号 return RxRoom.createSingle Single<List<DummyObject>>
cannot find symbol return RxRoom.createSingle when a dao is set to return Single<List<DummyObject>>
我实际上是 rxjava 的新手,并试图通过 returng Single> 从我的 dao 中使用它,但我一直找不到符号 return RxRoom.createSingle 在构建时间,下面是我的 dao
@Transaction
@Query("SELECT * FROM child_dependent_table WHERE isPrincipalActive =1")
Single<List<ChildAndBiometric>> childListByActive();
如果您需要任何信息
您需要将以下依赖项添加到您的成绩设置中:
implementation "androidx.room:room-rxjava2:$room_version"
implementation "androidx.room:room-runtime:2.2.5"
kapt "androidx.room:room-compiler:2.2.5"
implementation "androidx.room:room-ktx:2.2.5"
implementation "androidx.room:room-rxjava2:2.2.5"
嘿,你确定你有上面概述的依赖项吗?我在使用 arch-components
导入而不是 android-x 版本的项目中遇到问题。如果您查看该版本的源代码,它只有创建 Flowable 和 Observable 的静态信息,这会给您带来您所看到的错误
我实际上是 rxjava 的新手,并试图通过 returng Single> 从我的 dao 中使用它,但我一直找不到符号 return RxRoom.createSingle 在构建时间,下面是我的 dao
@Transaction
@Query("SELECT * FROM child_dependent_table WHERE isPrincipalActive =1")
Single<List<ChildAndBiometric>> childListByActive();
如果您需要任何信息
您需要将以下依赖项添加到您的成绩设置中:
implementation "androidx.room:room-rxjava2:$room_version"
implementation "androidx.room:room-runtime:2.2.5"
kapt "androidx.room:room-compiler:2.2.5"
implementation "androidx.room:room-ktx:2.2.5"
implementation "androidx.room:room-rxjava2:2.2.5"
嘿,你确定你有上面概述的依赖项吗?我在使用 arch-components
导入而不是 android-x 版本的项目中遇到问题。如果您查看该版本的源代码,它只有创建 Flowable 和 Observable 的静态信息,这会给您带来您所看到的错误