Paging3 not sure how to convert PagingSource

936 views Asked by At

Here is the actual error

C:\Users\Michal\AndroidStudioProjects\swibbidandroidkotlin\app\build\tmp\kapt3\stubs\debug\dk\swibbid\mz\data\model\ProductDao.java:28: error: Not sure how to convert a Cursor to this method's return type (androidx.paging.PagingSource<java.lang.Integer,dk.swibbid.mz.data.model.Product>).
public abstract java.lang.Object getAllProductsPagination(@org.jetbrains.annotations.NotNull()
warning: File for type 'dk.swibbid.mz.SwibbidApplication_HiltComponents' created in the last round 
will not be subject to annotation processing.
> Task :app:kaptDebugKotlin FAILED

This error should not come up since because i got the correct dependenies but it still does:

implementation "androidx.room:room-runtime:2.3.0-alpha03"
kapt "androidx.room:room-compiler:2.3.0-alpha03"
implementation "androidx.room:room-ktx:2.3.0-alpha03"
implementation "androidx.paging:paging-runtime:3.0.0-alpha07"

I have tried using all the old dependencies but its still same error. I tried clean build and rebuild project.

I have already looked at this post :

Paging3: "Not sure how to convert a Cursor to this method's return type" when using PagingSource as return type in Room DAO

1

There are 1 answers

0
Sasjumb On

Ok i fixed the problem, the Dao function cannot be a suspend function...

Wish the error told me that instead