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.
Using Room
I'm getting this error and I'd like to find out which method causes it.
I have multiple DAO
s, with approximately 60 methods in total, and this error just popped up after adding a method (copy&pasted from another one that worked perfectly, just changed the field to set).
I could post the whole class of DAO
s, but I'm asking for a way to know which method failed. I tried with Run with --stacktrace
, Run with --info
and --debug option
, but none of these show any valuable information.
The method I added is a @Query
UPDATE
with Int
return type, as suggested in the documentation
UPDATE or DELETE queries can return void or int. If it is an int, the
value is the number of rows affected by this query.
EDIT: I'd like to add that I tried deleting the method, bringing the DAO back to the working state, but it still gives me this error.
EDIT2: Adding gradle console output because unreadable in comments:
error: Not sure how to convert a Cursor to this method's return type
error: Not sure how to convert a Cursor to this method's return type
2 errors
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…