【问题标题】:Room with RxJava3带有 RxJava3 的房间
【发布时间】:2021-01-30 21:55:16
【问题描述】:

我尝试在 Room DAO 上使用 Flowable,但它给了我这个错误:

error: Not sure how to convert a Cursor to this method's return type
Flowable<List<Category>> getAllCategories();

我的查询如下所示:

@Query("select * from categories_table order by name;")
Flowable<List<Category>> getAllCategories();

依赖关系:

def room_version = "2.3.0-beta01"
    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version"
    implementation "androidx.room:room-rxjava3:$room_version"

【问题讨论】:

    标签: android rx-java android-room


    【解决方案1】:

    要解决此问题,请尝试将implementation 的值更改为"androidx.room:room-runtime:2.3.0-beta01",并为annotationProcessor 使用"androidx.room:room-compiler:2.3.0-beta01"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-23
      • 1970-01-01
      • 1970-01-01
      • 2021-11-24
      • 1970-01-01
      • 2020-05-06
      • 2020-01-04
      • 2011-10-14
      相关资源
      最近更新 更多