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

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

    Make sure if there is

    There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such table: METRO)


    error in your build log before the error you mentioned in your description. If it is, you may have forgotten to add your new entity Pojo to database class. something like this

    @Database(entities = {Table.class,ForgottenTable.class}, version = 1) 
    public abstract class Database extends RoomDatabase {
        //class codes
    }
    

提交回复
热议问题