简体   繁体   中英

Room with RxJava3

I tried to use Flowable on Room DAO but it is giving me this error:

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

My query looks like this:

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

Dependencies:

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"

To fix this, try changing the implementation value to "androidx.room:room-runtime:2.3.0-beta01" , and for the annotationProcessor use "androidx.room:room-compiler:2.3.0-beta01" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM