Skip to content
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

Fatal Exception: java.lang.RuntimeException: librealm-jni.so #4702

Closed
michaelbukachi opened this issue May 24, 2017 · 17 comments
Closed

Fatal Exception: java.lang.RuntimeException: librealm-jni.so #4702

michaelbukachi opened this issue May 24, 2017 · 17 comments
Labels

Comments

@michaelbukachi
Copy link

So I get this error from one of my testers. The device is a samsung running on arm64-v8a. I have split my apks according to architecture for small size. Could this be a bug?
Realm version : 3.2.1
Fatal Exception: java.lang.RuntimeException: Unable to create application dita.dev.myportal.MyPortal: up: lib/armeabi/librealm-jni.so at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4351) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5021) 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:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java) Caused by up: lib/armeabi/librealm-jni.so at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(Unknown Source) at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(Unknown Source) at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(Unknown Source) at com.getkeepsafe.relinker.ReLinker.loadLibrary(Unknown Source) at com.getkeepsafe.relinker.ReLinker.loadLibrary(Unknown Source) at io.realm.internal.RealmCore.loadLibrary(Unknown Source) at io.realm.Realm.init(Unknown Source) at dita.dev.myportal.MyPortal.onCreate(Unknown Source) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4348) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5021) 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:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java)

@Zhuinden
Copy link
Contributor

So what are your abiSplits config in build.gradle?

@kneth
Copy link
Contributor

kneth commented May 24, 2017

@michaelbukachi The stack trace indicates that the 32 bit ARM .so file is loaded (lib/armeabi/librealm-jni.so).

@michaelbukachi
Copy link
Author

splits {
        abi {
            enable gradle.startParameter.taskNames.contains(":app:assembleFreeRelease")
            //enable gradle.startParameter.taskNames.contains("Release")
            reset()
            //include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            include 'armeabi-v7a', 'arm64-v8a'
            universalApk true
        }

        //density {
        //    enable true
        //    exclude 'xxxhdpi', 'tvdpi', 'ldpi', 'hdpi'
        //}
    }

This is the split section of the gradle file

@beeender
Copy link
Contributor

beeender commented May 25, 2017

@michaelbukachi check your apk file, my guess is there are some other 3rd party so files with armebi packed with realm eabi-v7a or arm64-v8a so file.
if you have multiple native libs, you need to make sure all of them have SAME ABI so files packed in to the apk file.

@michaelbukachi
Copy link
Author

I've just checked each apk, besides the universal apk, each apk has only one .so file for realm. There are no other compiled libraries in the apks

@michaelbukachi
Copy link
Author

@kneth How is that possible? Could gradle be putting the wrong .so file in the apk??

@beeender
Copy link
Contributor

Which apk did you install on the Sumsang device and had the issue? The universal apk or the splited apk? Can you share it with us? to help@realm.io if you can share it. thanks.

@michaelbukachi
Copy link
Author

@beeender According to the version code it was the one for arm64-v8a (so it was split). Let me send you guys the apk

@beeender
Copy link
Contributor

I got your apk file, it looks alright, maybe there are some problem with relinker or the abi reporting by the device.

Can you get below info from the Samsung device:

adb shell getprop | grep abi

@michaelbukachi
Copy link
Author

michaelbukachi commented May 25, 2017 via email

@kneth
Copy link
Contributor

kneth commented May 25, 2017

@michaelbukachi If possible, it would be great if you can send us the full crash report.

@michaelbukachi
Copy link
Author

michaelbukachi commented May 25, 2017 via email

@beeender
Copy link
Contributor

So from the information, the device is running on Android 4.4.2, but the 64 bit support is from android 5.0. So install the 64 so only apk on this device surely will cause the problem.
But I don't think it will happen to the real user if they install from google play since google play will install the universal apk or the armeabi-v7a apk to this specific device.

Can you confirm that this is caused by manually installing the 64 bit only apk to the device?

@michaelbukachi
Copy link
Author

michaelbukachi commented May 26, 2017 via email

@beeender
Copy link
Contributor

beeender commented May 28, 2017

So is it possible for playstore to download the wrong version of the apk??

As far as I know, if the device reported the right ABI, it will always get the right apk to install from play store.

BTW.: SM-G900R7 is using Qualcom Snapdragon 801, which is a 32 bits cpu device.

@michaelbukachi
Copy link
Author

It seems the issue is only appearing on one device, I've asked the user to check his device out. It doesn't seem to be bug since no other tester is being affected by this issue. I think this issue can now be closed

@nhachicha
Copy link
Collaborator

Thanks @michaelbukachi

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants