init realm calling Realm.init(context)
Caused by: com.getkeepsafe.relinker.MissingLibraryException: Could not find 'librealm-jni.so'. Looked for: [armeabi-v7a, armeabi], but only found: [].
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:173)
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.initializeRealm(Realm.java:322)
at io.realm.Realm.init(Realm.java:265)
looks like the tool is not including the library .so,but if i use the previous version 6.0.2 its works fine. see images
debug apk with realm 6.0.2 android studio 3.5.3 build tools 3.5.3 , device nexus 6 android 6.0.1

debug apk with realm 6.1.0 android studio 3.5.3 build tools 3.5.3 , device nexus 6 android 6.0.1

just call Realm.init method in a your oncreate method of your application class.
Realm version(s): 6.1.0
Realm Sync feature enabled: No
Android Studio version: 3.5.3
Android Build Tools version: 3.5.3
Gradle version: 5.4.1
Which Android version and device(s): Nexus 5 with android 6.0.1
The armeabi-v7a shared library is included in the AAR https://bintray.com/realm/maven/download_file?file_path=io%2Frealm%2Frealm-android-library%2F6.1.0%2Frealm-android-library-6.1.0.aar could clean your maven local repository and post your gradle configs?
its included but the output apk or .aab is not including it.
Sounds like there is a problem in how you are building the app bundle then?
i don't think so, in the screenshots above i show whats is the result with a previous version of realm. is like the plugin fails putting the .so for armeabi-v7
Facing Same issue here. Waiting for a solution.

Updating, after generating .aab file, I inspected them and the library is there. After I see on which devices the errors are occurring, all of them are rooted devices. Any other devices still working as expectedly.
@kelvin-lima How did you solve this?
@sudokai as i said, the problem only occurs on Rooted devices. I ignored them and now I'm currently migrating to SQLite+Room, because this bug and some other reasons.
hey @kelvin-lima would you mind emailing me at ian.[email protected] - I would love to pick your brain on some of the other reasons that drove you to migrate to SQLite+Room
Do we have any updates or workaround?
@ahulyk i will close the issue, later 2 weeks i found was a issue in the android studio build tool
What kind of issue in the android studio build tool?
Still getting this on some devices (Mi 9X android 5.1).
I'm using CI to build app bundle with following config:
com.android.tools.build:gradle:3.6.3
gradle-5.6.4
Any ideas?
Found one instance of this crash for a user in a release apk, we're stuck on 6.1.0 but did any fixes get pushed for 7.0.0 and up? The librealm-jni-so is present for armeabi-v7a in the apk.
h.f.a.c: Could not find 'librealm-jni.so'. Looked for: [armeabi-v7a, armeabi], but only found: [].
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary()(ApkLibraryInstaller.java:173)
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.initializeRealm()(Realm.java:322)
at io.realm.Realm.init()(Realm.java:265)
Realm version(s): 6.1.0
Realm Sync feature enabled: No
Android Studio version: 4.0.1
Android Build Tools version: 28.0.3
Gradle version: 5.4.1
Which Android version and device(s): Clover C300 with Android 4.4.2
was facing the same issue, stopped using aab, is the issue fixed on io.realm:realm-gradle-plugin:7.0.0 ? is it safe to use android bundle now ?
How to avoid this error for armeabi-v7a? I have users with armeabi-v7a architecture and they are rating 1 star because of this issue. I have uploaded apk instead of bundle but still error not resolved for armeabi-v7a devices.
i was able to reduce the apk size by 5mb using split apk,
realm gradle: classpath "io.realm:realm-gradle-plugin:7.0.0-beta-SNAPSHOT"
// APK splitting
splits {
abi {
// Enable APK splitting wrt architecture
enable true
// Reset the architectures for which you need to build the APKs for
reset()
// Include the architectures for which Gradle is building APKs
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
// Set this to false if you don't want an APK that has native code for all architectures
universalApk false
}
}
// Assign codes to each architecture
project.ext.versionCodes = ['x86': 0, 'x86_64': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3]
// Add the architecture-specific codes above to base version code, i.e. the version code specified in the defaultConfig{} block
// Example: 2000 is the base version code -> 2000 (x86), 2001 (x86_64), 2002 (armeabi-v7a) & 2003 (arm64-v8a) would be the version codes for the generated APK files
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
output.versionCodeOverride = project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1 + android.defaultConfig.versionCode
}
}
upload apks to developer console x86, x86_64, armeabi-v7a, arm64-v8a respectively.
I updated from 6.x.x to 10.0.1
Everything seems to be working fine and that error went away
Most helpful comment
Updating, after generating .aab file, I inspected them and the library is there. After I see on which devices the errors are occurring, all of them are rooted devices. Any other devices still working as expectedly.