Room “Not sure how to convert a Cursor to this method's return type”: which method?

后端 未结 20 1403
遇见更好的自我
遇见更好的自我 2020-12-14 14:15
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          


        
20条回答
  •  死守一世寂寞
    2020-12-14 15:12

    Yup, based on what you have mentioned in the comments, you are not allowed to change the return type from List to anything else inside the Dao. I'd assume Room doesn't know how to deal with other return types. Take the List and cast/convert it into your desired type outside of the Dao.

提交回复
热议问题