1

I upgraded Realm version from io.realm:realm-gradle-plugin:5.1.0 to 10.8.1 with no issue. However, then I had to test an earlier version of my app, so I completely uninstalled the app that used 10.8.1 from the phone and reinstalled the app that used Realm 5.1.0. I then get a crash when opening a Realm for the first time with the following error:

io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.my.app/files/fileName.realm': 
Unsupported Realm file format version. (Unsupported Realm file format version) (/data/data/com.my.app/files/fileName.realm) 
in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp 
line 101 Kind: ACCESS_ERROR.

It's like the file already exists, even after a fresh install.

zetatlas
  • 320
  • 2
  • 8

1 Answers1

0

I fixed this by adding Realm.delete(configuration) when the app - the one using 5.1.0 - first started just to manually delete the file the exception was complaining about. Then I removed the Realm.delete line and did another fresh install. Everything worked fine after that.

zetatlas
  • 320
  • 2
  • 8