RealmError: Incompatible lock file / After 2.0 RealmFileException All processes sharing a single file must be the same architecture.
Goal
To report specific error after upgrading v0.88.0
Expected Results
Crash is not occurred.
Actual Results
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file in io_realm_internal_SharedGroup.cpp line 113
at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
at io.realm.internal.SharedGroup.(SharedGroup.java:63)
at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:48)
at io.realm.BaseRealm.(BaseRealm.java:76)
at io.realm.Realm.(Realm.java:138)
at io.realm.Realm.createAndValidate(Realm.java:268)
at io.realm.Realm.createInstance(Realm.java:248)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
at io.realm.Realm.getInstance(Realm.java:213)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
at android.view.View.dispatchAttachedToWindow(View.java:12626)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2473)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1264)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1047)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5896)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5120)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(NativeStart.java)
Steps & Code to Reproduce
I got this stack trace from Fabric. I've tested several devices that we have, i can't reproduce it. Instead, i attached some code that error is happening.
FYI, at this update (to v0.88.0), we upgraded Realm's schema version.
(We're using deleteRealmIfMigrationNeeded option)
Code Sample
@Override
protected void onAttachedToWindow() {
homeBadgeSubscription = Realm.getInstance(CoupleApplication.getRealmHome())
.where(RHomeCardViewView.class)
.equalTo("closed", false)
.equalTo("newIndicator", true)
.findAllAsync()
.asObservable()
.filter(RealmResults::isLoaded)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BasicSubscriber. <RealmResults<RHomeCardViewView>>create().next(homeCardViewViews -> {
int size = homeCardViewViews.size();
updateTextView(size);
}));
@Override
protected void onDetachedFromWindow() {
if (homeBadgeSubscription != null) {
homeBadgeSubscription.unsubscribe();
}
}
Version of Realm and tooling
Realm version(s): v0.88.0
Which Android version and device: When i first saw this crash, i think this is occurred because users are using BlackBerry. But now Android users have a crash.

The peak point is yesterday. (Realm v0.88.0)

@hohnamkung
- Can you share the latest apk with us? to [email protected]
- Are you using Realm in different processes? eg. Some services are running in a different process and accessing the same Realm which is used in the main activity as well.
Is it the first time when the getInstance() gets called in the app?
Yes. I've just tested.
Realm.getInstance(CoupleApplication.getRealmHome()) is first invoked at that point.
We're using single process (don't declare any process in AndroidManifest.xml)
In AppWidgetProvider we query realm (same configuration, CoupleApplication.getRealmHome), but i think that that code run on same process. (http://stackoverflow.com/a/11017453/4444109)
@hohnamkung Two more questions:
- Do you have any more information about how many crashed devices are 64bit?
- Do you ship the Realm's arm64 so with the apk?
APK at https://secure.helpscout.net/conversation/181563825/3381/?folderId=366141
-
I'm not sure how many it is, but top 3 devices in Samsung and LG are 32bit OS

-
No. I excluded it on purpose to prevent some device from
can't load so file exception.packagingOptions { // Workaround for failing to fall back to choose a non-64bit version of so exclude "lib/arm64-v8a/librealm-jni.so" exclude "lib/x86_64/librealm-jni.so" }
@hohnamkung We just released 0.88.2, it has a potential fix of this problem (which i am not sure could solve this, but worth a try), and some more information about the exception is added to help us debug if it still happens. And it also has a fix for the bad version problem you have.
Would you please give it a try? And let us know if this problem is still there. thanks a lot, and sorry for those troubles.
@beeender I'll release new version using 0.88.2 sooner than later! Thanks!
Hi @beeender After update, i still have a problem (Exception log is a little changed)
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file. Shared info version doesn't match, 4 5. in io_realm_internal_SharedGroup.cpp line 113
at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
at io.realm.internal.SharedGroup.(SharedGroup.java:64)
at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:49)
at io.realm.BaseRealm.(BaseRealm.java:76)
at io.realm.Realm.(Realm.java:138)
at io.realm.Realm.createAndValidate(Realm.java:268)
at io.realm.Realm.createInstance(Realm.java:248)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
at io.realm.Realm.getInstance(Realm.java:213)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
at android.view.View.dispatchAttachedToWindow(View.java:12658)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2473)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2480)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1255)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1038)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5889)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5118)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(NativeStart.java)
Thanks a lot for the information, i will check and get back to you ASAP.
And another crash log is collected. If you think that it's is a another problem, i'll make a other issue.
Fatal Exception: java.lang.IllegalArgumentException: Illegal Argument: Invalid format of Realm file.
at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java)
at io.realm.internal.SharedGroup.(SharedGroup.java)
at io.realm.internal.SharedGroupManager.(SharedGroupManager.java)
at io.realm.BaseRealm.(BaseRealm.java)
at io.realm.Realm.(Realm.java)
at io.realm.Realm.createAndValidate(Realm.java:268)
at io.realm.Realm.createInstance(Realm.java:248)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
at io.realm.Realm.getInstance(Realm.java:213)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.updateHomeBadge(MainTabIndicator.java:138)
at kr.co.vcnc.android.couple.feature.MainTabIndicator.onAttachedToWindow(MainTabIndicator.java:83)
at android.view.View.dispatchAttachedToWindow(View.java:11888)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2521)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2528)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1207)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1006)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4225)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4786)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(NativeStart.java)
Please create another issue for that, it seems to be another problem. Thanks!
http://crashes.to/s/0762fe58804
@hohnamkung has confirmed that @beeender's workaround works well.
@dalinaum I have an app in play store [https://play.google.com/store/apps/details?id=com.isletsystems.android.cricitch.lite] that is growing steadily, and is experiencing the same error @hohnamkung detailed, in my most recent build that I published.
I had built the app with the following:
- classpath 'io.realm:realm-gradle-plugin:0.88.2'
- buildToolsVersion '24.0.0-rc2'
- com.android.support:23.2.1
error from crashlytics: Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. Incompatible lock file. Shared info version doesn't match, 4 5. in io_realm_internal_SharedGroup.cpp line 113 at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(SharedGroup.java) at io.realm.internal.SharedGroup.(SharedGroup.java:64) at io.realm.internal.SharedGroupManager.(SharedGroupManager.java:49) at io.realm.BaseRealm.(BaseRealm.java:76) at io.realm.Realm.(Realm.java:138) at io.realm.Realm.createAndValidate(Realm.java:268) at io.realm.Realm.createInstance(Realm.java:248) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114) at io.realm.Realm.getInstance(Realm.java:213) at com.isletsystems.android.cricitch.app.CricitchApplication.onCreate(CricitchApplication.java:69) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4609) at android.app.ActivityThread.access$1600(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1337) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5476) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) at dalvik.system.NativeStart.main(NativeStart.java)
Looking forward to a new release of realm java with a fix for the same.
@appsailor Can you list those devices which have this problem? Maybe we are lucky enough to have one of them to reproduce the issue.
@beeender here are those devices experiencing problems.

Any luck with this issue getting resolved? Thx in advance.
@appsailor Sorry, but we still have no luck to reproduce the issue...
@appsailor Sent a mail to you email address :)