question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SoLoader is not compatible with Android app bundles

See original GitHub issue

We’re seeing crashes in SoLoader in production when loading libreactnativejni.so. We’re using React Native 0.59 and SoLoader 0.6.0.

The crash occurs on a range of devices, on Android OS versions 6 through 10. Google devices seem especially prone, notably the Pixel and Chromebook Plus V2.

The crashes appear to stem from our switch to using an app bundle rather than an APK on the Google Play store. This looks possibly related to https://github.com/facebook/SoLoader/issues/30, but that issue is marked as resolved in 0.6.0.

It looks like the app is sometimes attempting to link against old copies of some of the libraries. Here are some examples:

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: cannot locate symbol "_ZN3fLI7FLAGS_vE" referenced by "/data/app/com.fanduel.android.self-1/lib/arm/libglog.so"...

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: cannot locate symbol "_ZN8facebook5react15makeJIntOrThrowEx" referenced by "/data/app/com.fanduel.android.self-7bFAALdOGMNizGU2gL_5nA==/lib/arm/libreactnativejni.so"...

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: library "/data/user/0/com.fanduel.android.self/lib-0/libreactnativejni.so" not found

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: dlopen failed: library "libfb.so" not found

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libfb.so caused by: dlopen failed: library "/data/user/0/com.fanduel.android.self/lib-0/libfb.so" not found

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.fanduel.android.self/lib-1/libc++_shared.so" is 32-bit instead of 64-bit (this last one started appearing after we added 64-bit support)

I wonder if the problem is just that the filesystem sometimes isn’t fully flushed and ends up in an inconsistent state. Inspecting the SoLoader code, it tries to be robust (e.g. comparing a manifest of extracted files against the contests of the APK zipfiles) but it’s hard to say if it’s bulletproof. Maybe the manifest file is updated, but the writes to the .so files aren’t completed, so the app thinks it has the current libraries installed when in fact it still has the old ones.

Sorry for the lack of detail, I’m still trying to get a clearer picture of what’s going on! The crash rate is quite low and we haven’t managed to reproduce it ourselves. However, I think I’ve seen enough to be confident that it’s the combination of SoLoader and app bundles that causes the problem.

We plan to switch back to using an APK instead of an app bundle to see if that avoids the problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
benjakubencommented, Jul 7, 2020

Bumping this issue as we are still seeing this when attempting to use app bundles for a React Native application.

Fatal Exception: java.lang.UnsatisfiedLinkError couldn’t find DSO to load: libhermes.so

RN version 0.62

2reactions
ursnjcommented, Sep 26, 2019

i tried with react-native 0.61.1 but still issue is there. not sure what to do with this inconsistencies 😦 which file we need to keep this force code ???

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix apps with bad SoLoader versions - Google Help
Go to the App bundle explorer. Select the non-compliant APK/app bundle's App version at the top right dropdown menu, and make a note...
Read more >
React Native: App crashes on start due to SoLoader issue
all section to android/build.gradle file. This solved the issue for me. don't forget to run ./gradlew clean inside android folder. allprojects { ...
Read more >
Android App Bundle frequently asked questions
Bundles are supported by Google Play and some other app stores. ... No, you are not prevented from publishing to other app stores....
Read more >
Adding Flipper to Android apps with Gradle
You should also explicitly depend on SoLoader instead of relying on transitive dependency resolution, which is getting deprecated with Gradle 5. There is...
Read more >
Issue in loading native lib after migrating from gradle 3.2.1 to ...
We have enabled app bundle in our application and it is in production. We have migrated our app from 3.2.1 to 3.3.1, since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found