Android updating Realm 5.12 to 5.15 throws exception

(Taulant Loshi) #1

Recently I updated Realm plugin version 5.12 to 5.15.1 and when the app launches it’s throwing an exception even thought I did not change any of the database models. I’m using Realm default configuration and this is the exception:

E/UncaughtException: java.lang.IllegalStateException: The following changes cannot be made in additive-only schema mode:

  • Property ‘__ResultSets.updated_at’ has been made required.
  • Property ‘__ResultSets.updated_at’ has been made required.

How to solve thiss issue caused by only SDK update.

(Simon Persson) #2

I get the same here. Are you adding Permission objects to your local files? If so you will have to do a migration whenever Realm decides to update those objects.

The reason I have permissons in my local objects is simply to be able to reuse the objects between local an synced realms. For synced realms these changes doesn’t make any difference, but for local realms they do. Not sure what is the best way to handle this, but I think you will have to do a realm migration to add the new properties.

(Christian Melchior) #3

For some reason some fields changed from being optional to being @Required in Realm Java 5.13.0 . I’m trying to figure out exactly why this happened, but this is what the error complains above. Unfortunately there isn’t a clear work-around until we can release a fix other than deleting the existing file or wait a little with the upgrade.