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

后端 未结 20 1376
遇见更好的自我
遇见更好的自我 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:18
    @Query("select * from movie_action")
        suspend fun getMovieActionRoom() : LiveData<List<MoviesActionModel>>
    

    just remove suspend and the error will be gone in some cases.

    0 讨论(0)
  • 2020-12-14 15:20

    Make sure you are not using suspend together with LiveData as return type:

    @Query("SELECT * FROM ...")
    fun getAllTellsByReceiver(receiverUid: String): LiveData<List<Tell>>
    
    0 讨论(0)
提交回复
热议问题