-
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
BadVersionException OR N5realm11SharedGroup10BadVersionE #6310
Comments
I assume the Realm file is deleted but it hadn't been closed properly first on all threads and all instances. |
@Zhuinden Can you share any reference or documentation on who to properly close Realm instances? |
@telvinqburst How exactly are you deleting the files? |
Closing due to inactivity. Please re-open if this is still an issue. |
i am also getting the same issue. |
So is it 0.85.0 or 5.0.0? Why do you have 2 different versions of Realm in your project?? |
Goal
I am trying to delete realm file programmatically and create new realm file each time a new user logs into the app. When I create a new realm file with same name as previously deleted file and try to use realm defatult instance to query in the new realm file, crash occurs.
Actual Results
Steps & Code to Reproduce
Scenario:
1, First realm file is created - "USER1.realm"
2, Delete "USER1.realm" and create new realm file for user 2 - "USER2.realm"
3, Delete "USER2.realm" and create new realm file for user 1 - "USER1.realm"
4, Crash happens on using Realm.getDefaultInstance().
realmConfiguration = new RealmConfiguration.Builder()
.name(encryptKeyProvider + ".realm")
.initialData(new InitialData())
.schemaVersion(REALM_SCHEMA_VERSION)
.encryptionKey(key)
.deleteRealmIfMigrationNeeded()
.build();
Version of Realm and tooling
Realm version(s): 5.8.0
Realm Sync feature enabled: No
Android Studio version: 3.1.4
Android Build Tools version: 27
Gradle version: 3.2.1
Which Android version and device(s): For all device
The text was updated successfully, but these errors were encountered: