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

Couldn't find "librealmc.so" in the AndroidUtilsKt.loadAndroidNativeLibs #1447

Open
ChrisKruegerDev opened this issue Jul 12, 2023 · 8 comments

Comments

@ChrisKruegerDev
Copy link

ChrisKruegerDev commented Jul 12, 2023

How frequently does the bug occur?

Sometimes

Description

A few users get an exception on the startup due to a Realm initialization issue.

Stacktrace & log output

Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.moviebase-4RfS6EnT75kRXk7vq6VROg==/base.apk"],nativeLibraryDirectories=[/data/app/com.moviebase-4RfS6EnT75kRXk7vq6VROg==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "librealmc.so"
       at java.lang.Runtime.loadLibrary0(Runtime.java:1029)
       at java.lang.System.loadLibrary(System.java:1673)
       at io.realm.kotlin.internal.AndroidUtilsKt.loadAndroidNativeLibs(AndroidUtils.kt:20)
       at io.realm.kotlin.internal.RealmInitializer.create(RealmInitializer.kt:42)
       at io.realm.kotlin.internal.RealmInitializer.create(RealmInitializer.kt:30)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
       at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
       at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
       at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
       at android.content.ContentProvider.attachInfo(ContentProvider.java:1919)

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

1.10.1

What Atlas App Services are you using?

-- select --

Are you using encryption?

No

Platform OS and version(s)

Android 7 and 8

Build environment

No response

@clementetb
Copy link
Contributor

Are you distributing your app via AppBundle? Are you able to reproduce the crash locally?

Is it just related to Android versions 7 and 8, or there are other versions affected?

@ChrisKruegerDev
Copy link
Author

Yes, it is distributed via the aab file (bundle) and only for Android 7/8 devices. There are around 10 users within the latest 5 days.

@clementetb
Copy link
Contributor

clementetb commented Jul 13, 2023

We have received similar reports to this one, we think this issue is related to app bundle distribution and is not related to the Realm library. There are other parties affected by it.

In version 1.10.0 we disabled Relinker on SDK >= 23, in an effort of fixing the issue, but unfortunately from your report looks like it didn't.

The issue might be caused by users moving the app to the SD card, see Google issue, could you check if any of the solutions discussed there fixes the issue? We have unsuccessfully tried to reproduce it at our end.

  • setting the gradle property enableUncompressedNativeLibs=false, or
  • adding the following to your build.gradle:
android {
    packagingOptions {
        jniLibs {
            useLegacyPackaging = true
        }
    }
}

@ChrisKruegerDev
Copy link
Author

Hi @clementetb, thanks for the suggestions! I will try out the solutions and will come back with an answer.

@kirsteins
Copy link

@chrisnkrueger Any update on this? I am experiencing the same problem.

@ChrisKruegerDev
Copy link
Author

It seems the issue doesn't happen anymore in the newer realm versions (1.10).

@msa1422
Copy link

msa1422 commented Oct 11, 2023

Issue still persists on v1.11.1. Recorded on Android SDK 27 (8.1.0)
I haven't tried the solution proposed by @clementetb yet.

@ChrisKruegerDev
Copy link
Author

ChrisKruegerDev commented Oct 13, 2023

For not getting the issue, we deactivated the realm NDK splitting in the build.gradle.kts:

    bundle {
        abi {
            // do not split, because of missing library crashes
            enableSplit = false
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants