App crash due to missing libraries for `x86`, `armeabi-v7a`, `armeabi`
Description
We are encountering a crash in our Android app for some phones when using the Rive Android library. The app crashes on startup with the following error:
androidx.startup.StartupException: com.getkeepsafe.relinker.MissingLibraryException: Could not find 'librive-android.so'. Looked for: [x86, armeabi-v7a, armeabi], but only found: [arm64-v8a].
This indicates that the librive-android.so native library is missing for certain architectures, specifically x86, armeabi-v7a, and armeabi. The app only includes the library for the arm64-v8a architecture.
Provide a Repro
The crash occurs when running the app on devices with architectures other than arm64-v8a, such as armeabi-v7a or x86.
Steps to reproduce the issue:
- Integrate the Rive Android library into your Android app.
- Build and run the app on device with an armeabi-v7a or x86 architecture.
- Observe that the app crashes on startup with the missing library error.
Source .riv/.rev file
N/A – The issue occurs during app initialization, before any .riv files are loaded.
Expected behavior
The app should start without crashing, and the librive-android.so library should be correctly loaded for all supported architectures (armeabi-v7a, arm64-v8a, x86, etc.).
Screenshots
N/A
Device & Versions (please complete the following information)
- Device: Various devices with devices with no
arm64-v8aarchitecture from manufactures like ZTE, Oppo, Older Samsung devices, etc. - SDK Level: Android SDK API Level 35
Additional context
Here are the full stack traces from Firebase Crashlytics:
Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: com.getkeepsafe.relinker.MissingLibraryException: Could not find 'librive-android.so'. Looked for: [x86, armeabi-v7a, armeabi], but only found: [arm64-v8a].
at android.app.ActivityThread.installProvider(ActivityThread.java:5927)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5455)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6190)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by androidx.startup.StartupException: com.getkeepsafe.relinker.MissingLibraryException: Could not find 'librive-android.so'. Looked for: [x86, armeabi-v7a, armeabi], but only found: [arm64-v8a].
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
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:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at android.app.ActivityThread.installProvider(ActivityThread.java:5924)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5455)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6190)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by com.getkeepsafe.relinker.MissingLibraryException: Could not find 'librive-android.so'. Looked for: [x86, armeabi-v7a, armeabi], but only found: [arm64-v8a].
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:175)
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:51)
at app.rive.runtime.kotlin.core.Rive.init(Rive.kt:42)
at app.rive.runtime.kotlin.core.Rive.init$default(Rive.kt:37)
at app.rive.runtime.kotlin.RiveInitializer.create(RiveInitializer.kt:34)
at app.rive.runtime.kotlin.RiveInitializer.create(RiveInitializer.kt:32)
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:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at android.app.ActivityThread.installProvider(ActivityThread.java:5924)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5455)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6190)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
I am facing the same issue with mainly google phones
Hello, same here.
Crash is not limited to Google Phones. The main problem is that the crash occurs on the emulators used by Google to review apps. As a consequence our app keeps being rejected because of this issue.
@sherbaev @shakil-bin-karim were you able to troubleshoot or mitigate the issue ?
I'd like to bump this again as it is blocking Android submissions for us. Any Rive devs here that could give us a status?
I've had the same issue since September 2023 (my comments here).
This is not just limited to Emulators and happens on all Android versions. I'm currently using this library app.rive:rive-android:8.3.0. This is currently the most occurring crash on my Firebase Crashlytics.
@umberto-sonnino or @mjtalbot please can you offer some assistance.
Hi all,
Could you please point us to specific device models that consistently reproduce this crash? In fact, we've tested on a Samsung A13 with an armeabi-v7a ABI, and our example app starts and runs without issues, which suggests the problem isn't universally affecting all armeabi-v7a devices.
We'd like to get to the bottom of this - could you provide:
- The exact device model and Android version where you're experiencing crashes
- Whether you're using any specific build configurations that might affect ABI selection
- Confirm whether the crash is happens in our example app in this repo or, alternatively, give us a minimal sample project that demonstrates the issue
We're looking at #355 and potentially integrating the contribution, but we're going to need to validate it first
@DatL4g It seems one device where the crash occurs is Galaxy Feel. https://www.docomo.ne.jp/support/product/sc04j/spec.html
I am not entirely sure, but this issue may be more prevalent in Samsung devices using Exynos processors. Any non qualcom processor maybe possible suspect as weel.
Hi @shakil-bin-karim, @sherbaev, @evarouss, @JohnEstropia, @DJPretorius. Firstly, thank you all for your reports and confirmations. I'm the lead Android engineer at Rive, and I'm looking into this.
When we build Rive, we build with 4 ABIs: x86, x86_64, armeabi-v7a, and arm64-v8a. Technically the first two could be dropped as in practice no Android devices in market use x86. They are specified in our build.gradle - abiFilters. They are ultimately bundled in the .aar. Google Play then filters the correct version to the device at the time of download, assuming you're uploading as an Android App Bundle (.aab).
For any given version, you can inspect that all 4 ABIs are available. For instance I'm seeing that @DJPretorius mentioned 8.3.0. By navigating to our Maven repository's versions, clicking "Browse" next to the given version, and downloading the .aab, the extension can be changed to .zip and unzipped. Inside you'll find the jni folder, which should have all 4 ABIs as sub-folders, each with libc++_shared.so (the C++ standard library) and librive-android.so. These shared object files are linked at runtime with ReLinker, which we use for linking as we support API 21 - they explain the rationale here.
As for why you're all seeing these errors - I'm not sure. One thing to check is to ensure you're not excluding ABIs in your app's build.gradle, either with:
android {
splits {
abi {
include ...
}
}
}
or
android {
defaultConfig {
ndk {
abiFilters ...
}
externalNativeBuild {
cmake {
abiFilters ...
}
}
}
}
Additionally, it would be helpful to know which versions you're running on. Let me know if this information helps - we'll look to get to the bottom of this.
This is also impacting our app, but we caught it on a Testing track before deploying to production. The only crash we're seeing here is on Android 12, Google Pixel 12 Pro. We're not doing anything related to any NDK or ABIs in our gradle setup.
Stack trace (our app name and class's replaced with example:
Fatal Exception: java.lang.RuntimeException
Unable to create application com.example.app: com.google.crypto.tink.internal.v: Z2.L: Could not find 'librive-android.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].
Fatal Exception: java.lang.RuntimeException: Unable to create application com.example.app.ExampleApp: com.google.crypto.tink.internal.v: Z2.L: Could not find 'librive-android.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6767)
Caused by com.google.crypto.tink.internal.v
Z2.L: Could not find 'librive-android.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].
Caused by com.google.crypto.tink.internal.v: Z2.L: Could not find 'librive-android.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].
at androidx.startup.StartupException.<init>(StartupException.java:34)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
@ErikUggeldahl
Sorry for the late response.
We are not excluding ABIs in our App's build.gradle.
We have also run into something similar to this but its because of other libraries effecting another .so file. We have found the S24 and A13 have issues loading up the librive-android.so file and won't ever show the animations running. We have had to build out fallback images to prevent the crash on certain devices. This might be a DLL-**** issue with other libraries or your own app.
For us, we have a design system library that houses rive and our parent app uses that library to run animations it has. We have tried resolution strategies, updating our own libraries that have similar .so files and tried loading the library manually ourselves. Still fails on some devices. Especially the A13. We are out of ideas.
@ErikUggeldahl We are also seeing this, but largely on Vivo devices.