RealmFileException - INCOMPATIBLE_LOCK_FILE
Goal
To not crash when starting the application
Expected Results
The app to run smoothly
Actual Results
Exception: io.realm.exceptions.RealmFileException Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. (Incompatible lock file. Shared info version doesn't match, 771 10.) (/data/data/my.package.name/files/data.realm) in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101 Kind: INCOMPATIBLE_LOCK_FILE.
io.realm.internal.OsSharedRealm.nativeGetSharedRealm (Native Method) io.realm.internal.OsSharedRealm. (SourceFile:171) io.realm.internal.OsSharedRealm.getInstance (SourceFile:241) io.realm.BaseRealm. (SourceFile:134) io.realm.BaseRealm. (SourceFile:103) io.realm.Realm. (SourceFile:161) io.realm.Realm.createInstance (SourceFile:446) io.realm.RealmCache.doCreateRealmOrGetFromCache (SourceFile:342) io.realm.RealmCache.createRealmOrGetFromCache (SourceFile:282) io.realm.Realm.getInstance (SourceFile:375) my.package.name.realm.DB.getInstance (SourceFile:1104) my.package.name.realm.DB.getDataRealm (SourceFile:1055) my.package.name.realm.DB.getIdsThatMatchPropertyIds (SourceFile:559) my.package.name.util.user_prefs.PreferenceManager.getItemsOfAllPreferences (SourceFile:761) my.package.name.util.user_prefs.PreferenceManager.getBasePreferenceProportions (SourceFile:784) my.package.name.util.user_prefs.PreferenceManager.getTargetPreferenceProportions (SourceFile:806) my.package.name.util.user_prefs.PreferenceManager.lambda$getItemsForYou$1$PreferenceManager (SourceFile:178) my.package.name.util.user_prefs.PreferenceManager$$Lambda.run (Unknown Source:4) android.os.Handler.handleCallback (Handler.java:789) android.os.Handler.dispatchMessage (Handler.java:98) android.os.Looper.loop (Looper.java:164) android.os.HandlerThread.run (HandlerThread.java:65)
Steps & Code to Reproduce
Sadly i can't reproduce it manually. The error has been reported from production by a crash-reporting tool.
Code Sample
It's a quite big project, and the code mentioned above is simply the first time that Realm is called upon the app being opened, so i don't think the issues is specifically located in that code, but more of a general issue? If there are any specific parts that you think would be interesting, let me know and i can post those elements.
Version of Realm and tooling
Realm version(s): 5.5.0
Realm sync feature enabled: No
Android Studio version: 3.1.4
Which Android version and device: Reported on 2 devices so far:
- Samsung Galaxy S7 - Android 8.0.X
- Huawei P20 Lite Dual Sim LTE-A (ANE-L21) - Android 8.0.X
do you have Realm access inside broadcast receiver that is invoked by BOOT_COMPLETED?
@Zhuinden I do have a BOOT_COMPLETED broadcast receiver, but it does not access any parts of Realm.
But my Application's onCreate method does access Realm (it creates the needed RealmConfiguations). And i have 2x other broadcast receivers (1 causes a daily alarm) and 1x JobIntentService which all access Realm. They should be safe, as the only read from Realm and all check if RealmObject.isValid before usage. Though i did not know about process-issues...
From your post, i'm assuming that broadcast receives sometimes run in a different process? Or am i misinterpretation your post?
@Moonbloom Are you using encryption?
@cmelchior No, we're not.
Technically I just know this is the likely cause of what problems we had on Huawei P8 Lite, but I never got the test device so I couldn't really check.
Outdated, so closing.
We would either need a sample project demonstrating the issue or more detailed data about which devices this is happening on and under which circumstances.