Room cannot verify the data integrity

前端 未结 20 2273
一向
一向 2020-12-04 11:43

I am getting this error while running program with Room Database

Room cannot verify the data integrity. Looks like you\'ve changed schema but forgot to updat         


        
相关标签:
20条回答
  • 2020-12-04 12:34

    In my case I had an AppDatabase class.

    @Database(entities = {GenreData.class, MoodData.class, SongInfo.class,
        AlbumsInfo.class, UserFolderListsData.class, UserPlaylistResponse.PlayLists.class, InternetConnectionModel.class}, version = 3, exportSchema = false)
    

    I updated this version number and it solved the problem. Problem arose because i had added a property in SongInfo class and forgot to update the version number.

    Hope it helps someone.

    0 讨论(0)
  • 2020-12-04 12:38

    In my case I tried all of the above. Nothing seemed to work so the solution for me was simply setting android:allowBackup="false", install the app then set it back to true

    Hope it helps others :)

    0 讨论(0)
提交回复
热议问题