会议室无法验证数据完整性 [英] Room cannot verify the data integrity

查看:307
本文介绍了会议室无法验证数据完整性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Room数据库运行程序时出现此错误

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 update the version number. 
You can simply fix this by increasing the version number.

似乎我们需要更新数据库版本,但是我们可以从何处在Room中完成呢?

It seems we need to update Database version, but from where we can do that in Room?

推荐答案

Aniruddh Parihar 的回答给了我一个提示它解决了.

Aniruddh Parihar 's answer gave me a hint and it solved.

搜索在其中扩展了RoomDatabase的课程.在那里,您将找到类似以下的版本:

Search for a class where you have extended RoomDatabase. There you will find version like below :

@Database(entities = {YourEntity.class}, version = 1)

只需增加版本即可解决问题.

just increase the version and problem is solved.

这篇关于会议室无法验证数据完整性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆