Closed burhanrashid52 closed 6 years ago
Hello! Could you share all code?
https://stackoverflow.com/questions/46668605/paging-compile-issue-not-sure-how-to-convert-a-cursor-to-this-methods-return I have asked this question with detail code @n0lik
I resolved the issue by updating the libraries to the latest version
compile 'android.arch.persistence.room:runtime:1.0.0-beta2'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-beta2'
compile 'android.arch.paging:runtime:1.0.0-alpha3'
compile 'android.arch.lifecycle:runtime:1.0.0-beta2'
compile 'android.arch.lifecycle:extensions:1.0.0-beta2'
annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-beta2'
I am using androidx room lib and it is up to date. Still I am facing same issue.
implementation 'androidx.room:room-runtime:2.1.0'
This is an issue from 2017
If you're using Paging 2.1, you should instead use DataSource.Factory
, which room knows how to return, and pass that to a LivePagedListBuilder
Note that toLiveData
is an extension method which simply calls into https://developer.android.com/reference/android/arch/paging/LivePagedListBuilder
i have the same problem with paging 3
@liodali what room version are you using? Try using the latest one at the moment - 2.3.0-alpha02
i'm using version 2.2.5 for room and paging 3 alpha the build failed message : Not sure how to convert a Cursor to this method's return type androidx.paging.PagingSource
PagingSource was added in Room 2.3.0-alpha01+
Check whether you are not trying to insert a list of objects into your DB, you will need to either embed, use a foreign key or declare the relationship in another table
This is a full list of dependencies that helped me:
def roomVersion = "2.3.0-alpha03"
implementation "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
especially the part with
kapt "androidx.room:room-compiler:$roomVersion"
I am getting error for LivePagedListProvider Return type while compiling
Error:(22, 58) error: Not sure how to convert a Cursor to this method's return type
How to resolve this issue i have setup everything correct as per the sample documentation