-
Notifications
You must be signed in to change notification settings - Fork 198
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
Crash - Failed to load dynamic library 'librive_text.so' #403
Comments
Hi @daniel102102, which version of the Rive-Flutter runtime are you using? And did this recently start after updating? |
Hi @HayesGordon, we also see this error occur in our production app after updating the rive dependency from 0.13.1 to 0.13.7 (which bumps the rive_common dependency from 0.3.3 to 0.4.9 under the hood). We did not see any problems regarding the Rive-Flutter runtime before, it recently started to occur after the mentioned update. Like @daniel102102 mentioned this problem happens to 99% on devices running Android 6. |
@kaptnkoala I'd just like to confirm a few things.
One potentially relevant issue I've found is: simolus3/drift#895 (comment) More info here: simolus3/drift#895 (comment) We could look into doing something similar (it's a bit of a hack) but I'm unable to verify my side if this will work as I cannot reproduce the issue. Can you reproduce this issue on your end, or are you only seeing this in production? |
Hi @HayesGordon. We are using rive: 0.13.8 and rive_common: ^0.4.9. Massive crashes started in last days, after switching to new version. Before crash was avialble but was rare. |
Could you please confirm if you're Rive file makes use of Rive Text or Rive Audio. Answering this is important to help me pinpoint the issue. Could you also answer the other questions if possible. |
Hey @HayesGordon, please find the answers to your questions attached.
No, in our case the affected rive files are not using Rive Text or Rive Audio?
Yes, we are not building our app for the 'x86' architecture, so our release NDK settings look like this:
We only pass additional --dart-define Flags when building the release APK?
Yes, i can verify that the generated APK contains the librive_text.so in the 'lib/arm64-v8a', 'lib/armabi-v7a' and 'lib/x86_64' directories.
We are using Flutter 3.19.6 I am not exactly sure what workaround you are suggesting, because you seemed to have referenced the same issue comment twice. We also do not have Apps at Hand here right now and can reproduce the issue, we only see it as error with high volume in our reporting tools. For the moment we have reverted back to rive 0.13.1, which mitigated the problem for the production app. |
Thanks for the info @kaptnkoala. The other link I wanted to send was this: https://github.com/simolus3/sqlite3.dart/tree/main/sqlcipher_flutter_libs#problems-on-android-6 In older versions of Flutter, Android 6 caused issues, old documentation mentions:
But I do not know if that is still relevant. We can push out the same solution that sqlite3 did. It requires loading the library natively from Kotlin and then accessing it through the data directory. I'll let you know here once that is out. |
We have set the flag Has anything changed between version 0.13.1 and 0.13.8 how the livrive_text.so is loaded, that this problem is starting to gain track now and not in the previous version. I am not sure, if this is really the best solution to the problem. I will ping a colleague that is more familiar with the native parts of Flutter. @blaugold What do you think about this? |
After version But since then we've introduced more features, specifically a new layout engine, which requires Rive Flutter to always load + initialize the native library. That is why you're seeing it now and not before. On the Rive Android runtime we had similar issues in the past where Android has issues linking these libraries. There exists a package for Android called ReLinker which we use to ensure the libraries are linked on older devices. This is the first/only report about Rive Flutter not working on older Android devices. |
Link to the PR that made the change to require the libraries to always be loaded: a22fc5f |
Have you tried https://github.com/KeepSafe/ReLinker ? If your app includes native libraries, and your minimum SDK is below API 23 (Marshmallow), you need ReLinker. There are a number of different bugs addressed by ReLinker; the last of these was resolved as of Marshmallow. As long as your app's min SDK is at or above it, loading libraries via System.loadLibrary("foo") is safe. |
We are using @kaptnkoala Those workarounds feel a bit hacky, but the only solution for those older Android versions. 🫠 |
Refactors the library loading to reuse the same code across the different FFI modules. Introduces a workaround for Android library loading, potentially fixing [403](#403) Diffs= d5ed4ca9b feat: add applyWorkaroundToRiveOnOldAndroidVersions (#7485) 1e7b1c030 add missing validations (#7532) Co-authored-by: Gordon <[email protected]>
Hi all, this is now available in the latest release v0.13.11. You can call What this does is load the We were unable to reproduce the issue on our side; it may be conditional to other factors. Let us know if you implement this and if it works. |
@HayesGordon We have just released a new version including the fix. Will keep you updated how it works out! |
@HayesGordon We have now fully rolled out the version with your workaround and the fix seems work and resolve the problems we had on Android 6 devices. Is it possible to implement this handling in the default library opening process, so that this method does not have to be called explicitly and is handled in the |
Thank you for informing us @kaptnkoala, I'm glad it is resolved for you. I'll discuss this with the team. This is the only report that we have had about this, and it may be that this is an isolated incident and that some combination of the plugins or build config you have is what reproduced this. Which makes me hesitant to enable this by default. |
At least one other user has started this issue for this. Maybe is error is only more prominent to us because our app has a user base of 1.5M DAU and we are monitoring our release apps tightly. When you would implement this as a fallback option for the |
I am actually seeing this same issue on Android API 35 (brand new version, not old). 0.13.1 works fine, 0.13.13 does not |
Hi. We are using rive for flutter.
We see a massive crash in firabse on Android 5 and Android 6, see callstack below. It happens on various devices.
librive_text.so is included in compilation for all architectures.
The text was updated successfully, but these errors were encountered: