-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RealmMigrationNeededException on fresh install after model change #1856
Comments
Hi @adamsp RealmConfiguration(https://realm.io/docs/java/latest/api/io/realm/RealmConfiguration.html) has
Does this help? |
That certainly makes things easier! I'll stick with this for now, but I still find it curious that Android doesn't appear to delete all files in the directory on an app uninstall. Hopefully this helps someone else. |
5 months later I've finally figured this out as I check things off my pre-release TODO list. This was caused by Android 6.0 auto-backup. I had to disable this for my Realm files (I'm using the default configuration):
And
|
Adam, I owe you a beer. I was pulling my hair out and then came across your article: http://speakman.net.nz/blog/2016/04/21/handling-realmmigrationneededexception-on-a-fresh-installation-on-android/ Thank you very much! |
I'm working on integrating Realm in my Android application. My model changes from time-to-time during development, so I expect the
RealmMigrationNeededException
when this happens. I uninstall the app (adb uninstall my.package.name
), and then fresh install - but still get the exception.I can fix it by:
adb shell run-as my.package.name rm files/default.realm files/default.realm.lock
Shouldn't these be removed when I uninstall the app? I suspect this isn't a Realm issue but rather something to do with Android or adb - however I haven't had this issue with say, ORMLite. Any ideas?
Edit: I actually get this exception even if I don't change the model at all.
The text was updated successfully, but these errors were encountered: