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

后端 未结 20 1430
遇见更好的自我
遇见更好的自我 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:01

    In my case i was this problem when i used LiveData> in Dao class for getting all things from Room and i fixed this when i change ArrayList with List.

    Example(Kotlin):

    @Dao
    interface ExampleDao {
    @Query("SELECT * from example_table")
    fun getAllExample():LiveData>
    }
    

提交回复
热议问题