Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving "Unsupported Realm File Format" after upgraing

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

Any suggestions?

like image 529
Irina Tyshkevich Avatar asked Nov 07 '22 23:11

Irina Tyshkevich


2 Answers

Alright, I don't know if this is the right way to address this issue, but I just went in and deleted the default.realm file specified in the error message and it generate a new one and all is well with the world. Please let me know if there's a better solution. Cheers!

like image 59
Irina Tyshkevich Avatar answered Nov 15 '22 13:11

Irina Tyshkevich


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.

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.

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.

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.

like image 39
Joshua Pinter Avatar answered Nov 15 '22 14:11

Joshua Pinter