繁体   English   中英

Paging3 不知道如何转换 PagingSource

[英]Paging3 not sure how to convert PagingSource

这是实际的错误

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

这个错误不应该出现,因为我得到了正确的依赖,但它仍然存在:

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"

我已经尝试使用所有旧的依赖项,但它仍然是同样的错误。 我尝试了干净的构建和重建项目。

我已经看过这篇文章:

Paging3:在 Room DAO 中使用 PagingSource 作为返回类型时,“不确定如何将 Cursor 转换为该方法的返回类型”

好的,我解决了问题,Dao 函数不能是挂起函数...

希望错误告诉我,而不是

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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