接收“不支持的领域文件格式"升级后 [英] Receiving "Unsupported Realm File Format" after upgraing
问题描述
我正在使用 realm
和 react native
来编写一个移动应用程序.一切正常,然后我尝试在 Realm 浏览器中打开我的 default.realm 文件,此时它要求我升级到新版本.我升级并能够在浏览器中打开 default.realm 文件,但是当我在模拟器中打开我的应用程序时,我现在收到以下错误:
I'm using realm
and react native
to write a mobile app. Everything was working fine and then I tried to open my default.realm file in the Realm Browser at which point it asked me to upgrade to a new version. I upgraded and was able to open the default.realm file in the browser, however when I opened my app in the simulator, I get the following error now:
Unable to open a realm path at [REALM PATH]. Unsupported Realm File Format Version
有什么建议吗?
推荐答案
在你的应用中升级你的 realm
包.
当您在 Realm Studio 中更新 .realm
文件时,它与旧版本的 Realm 不兼容,因此模拟器上的应用程序无法再打开那个 .realm
文件.
Upgrade Your realm
package in Your App.
When you updated the .realm
file in Realm Studio, it became incompatible with older versions of Realm so the app on your simulator can no longer open up that .realm
file.
您应该做的就是更新应用程序中 realm
包的版本,这将使其与该 .realm
数据库的更新版本内联.
All you should have to do is update the version of realm
package in your application and that will move it inline with the updated version of that .realm
database.
我不得不做同样的事情,最终从 1.3.0 升级到 2.23.0.一个大更新,但后来一切都很好.
I had to do the same thing and ended up upgrading from 1.3.0 to 2.23.0. A big update, but then everything worked great.
如果您在更新后仍然遇到问题,我建议您删除 node_modules
,清理构建并取消链接任何现有的 Realm 库,这样您就不会意外使用缓存或旧版本.
If you still run into trouble after updating, I would suggest removing node_modules
, cleaning the build and unlinking any existing Realm libraries so you're not accidentally using a cached or older version.
这篇关于接收“不支持的领域文件格式"升级后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!