相关疑难解决方法(0)

房间"不确定如何将光标转换为此方法的返回类型":哪种方法?

Error:Not sure how to convert a Cursor to this method's return type
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Run Code Online (Sandbox Code Playgroud)

使用Room我收到此错误,我想找出导致它的方法.

我有多个DAOs,总共有大约60个方法,并且在添加方法之后弹出了这个错误(从另一个完美工作的复制和粘贴,只是将字段更改为设置).

我可以发布整个类的DAOs,但我想知道哪种方法失败了.我试着用Run with --stacktrace,Run with --info--debug option,但这些都不显示出任何有价值的信息.

我添加的方法是一个@Query UPDATEInt返回类型,如在建议的文档

UPDATE或DELETE查询可以返回void或int.如果是int,则该值是受此查询影响的行数.

编辑:我想补充一点,我尝试删除该方法,使DAO回到工作状态,但它仍然给我这个错误.

EDIT2:添加gradle控制台输出,因为在评论中不可读:

error: Not sure how to convert a Cursor to this method's return type
error: Not sure how to convert a Cursor to …
Run Code Online (Sandbox Code Playgroud)

android dao kapt android-room android-architecture-components

30
推荐指数
8
解决办法
2万
查看次数