【问题标题】:Paging3 not sure how to convert PagingSourcePaging3 不确定如何转换 PagingSource
【发布时间】:2020-10-21 13:28:11
【问题描述】:

这是实际的错误

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: "Not sure how to convert a Cursor to this method's return type" when using PagingSource as return type in Room DAO

【问题讨论】:

    标签: android kotlin android-room android-paging


    【解决方案1】:

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

    希望错误告诉我,而不是

    【讨论】:

      猜你喜欢
      • 2020-12-01
      • 2022-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-13
      • 2011-12-13
      • 1970-01-01
      相关资源
      最近更新 更多