We just uploaded our app to playstore using App Bundles and within couple hours we started receiving below crashes:
Fatal Exception: java.lang.RuntimeException: Unable to start service io.ona.kujaku.services.MapboxOfflineDownloaderService@2c791d48 with Intent { cmp=org.commcare.dalvik/io.ona.kujaku.services.MapboxOfflineDownloaderService (has extras) }: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/librealm-jni.so
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3961)
at android.app.ActivityThread.access$2300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1833)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6939)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/librealm-jni.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:180)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:57)
at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:60)
at io.realm.Realm.init(Realm.java:247)
at io.ona.kujaku.data.realm.RealmDatabase.<init>(RealmDatabase.java:34)
at io.ona.kujaku.data.realm.RealmDatabase.init(RealmDatabase.java:26)
at io.ona.kujaku.services.MapboxOfflineDownloaderService.onStartCommand(MapboxOfflineDownloaderService.java:158)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3944)
at android.app.ActivityThread.access$2300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1833)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6939)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
From this issue it looks like simply upgrading the realm-plugin to 6.1 should be enough(Though few comments seem to suggest that the issue is happening even on the latest realm-plugin) But at least we'll be able to get a better error message with the latest version.
Though, one thing that's constantly bothering me is how this MapboxOfflineDownloaderService is started. My first thought was KujakuNetworkChangeReceiver which can start the service on pre-Nougat devices. And yeah, we're also receiving IllegalStateException: Not allowed to start service Intent, app is in background crashes in android 7+ devices, but that's a different issue and that's already been filed #326 . But I don't think it's the culprit here since I'm getting the above MissingLibraryException even on android 9 devices. And we don't call KujakuLibrary. setEnableMapDownloadResume so that receiver shouldn't work at all on android 7+ devices right?
That being said, perhaps somebody else is starting this service. And we don't even call KujakuLibrary.init until we hit a particular screen, which is not used by any of the users so far. So I'd definitely like to know who's starting this service.
We just uploaded our app to playstore using App Bundles and within couple hours we started receiving below crashes:
From this issue it looks like simply upgrading the realm-plugin to 6.1 should be enough(Though few comments seem to suggest that the issue is happening even on the latest realm-plugin) But at least we'll be able to get a better error message with the latest version.
Though, one thing that's constantly bothering me is how this
MapboxOfflineDownloaderServiceis started. My first thought wasKujakuNetworkChangeReceiverwhich can start the service on pre-Nougat devices. And yeah, we're also receivingIllegalStateException: Not allowed to start service Intent, app is in backgroundcrashes in android 7+ devices, but that's a different issue and that's already been filed #326 . But I don't think it's the culprit here since I'm getting the aboveMissingLibraryExceptioneven on android 9 devices. And we don't callKujakuLibrary. setEnableMapDownloadResumeso that receiver shouldn't work at all on android 7+ devices right?That being said, perhaps somebody else is starting this service. And we don't even call
KujakuLibrary.inituntil we hit a particular screen, which is not used by any of the users so far. So I'd definitely like to know who's starting this service.