Couldn’t load “librealm-jni.so”
If your app uses other native libraries that don’t ship with support for 64-bit architectures, Android will fail to load Realm’s librealm-jni.so file on ARM64 devices. This is because Android cannot load 32-bit and 64-bit native libraries concurrently. The best solution would be to have all libraries provide the same set of supported ABIs, but sometimes that may not be doable if you are using a 3rd-party library. See VLC and Realm Library conflicts.
The workaround to this issue is to exclude Realm’s ARM64 library from the APK file by adding the following code to the app’s build.gradle. You can refer to Mixing 32- and 64-bit Dependencies in Android for more information.
android {
//…
packagingOptions {
exclude “lib/arm64-v8a/librealm-jni.so”
}
//…
}
在app的gradle中添加以上代码让打包的时候忽略64位的so文件
解决Android 64位架构下librealm-jni.so加载失败问题
本文介绍了解决在Android应用中由于使用不支持64位架构的第三方库而导致无法加载librealm-jni.so的问题。通过在build.gradle文件中排除64位版本的librealm-jni.so来规避此冲突。
4227

被折叠的 条评论
为什么被折叠?



