Room cannot verify the data integrity

前端 未结 20 2326
一向
一向 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:21

    If you are upgrading Room version to 1.0.0-alpha9 from old version then please visit below article. Very Good Article for Migrate from old version to 1.0.0-alpha9 version.

    https://medium.com/@manuelvicnt/android-room-upgrading-alpha-versions-needs-a-migration-with-kotlin-or-nonnull-7a2d140f05b9

    In Room New Version 1.0.0-alpha9 Room adds support for the NOT NULL constraint.

    That is going to change the schema that Room generates. Because it changes the schema, it also changes the identityHash of the DB and that is used by Room to uniquely identify every DB version. Therefore, we need a migration

提交回复
热议问题