Comments (23)
I am using firebase to track the crashes and a few of my users with following Android version are having crashes:
Android 4.2.2
Android 4.3
Android 4.3.1
Android 4.4.2
Android 5.1
Fatal Exception: java.lang.UnsatisfiedLinkError - couldn't find DSO to load: libhermes.so
I am using RN 0.60.5 and split APKs.
from hermes.
I'm seeing this crash in production with RN 0.61.2, using android bundles with hermes disabled.
from hermes.
Thanks @mhorowitz for the hint. I did look into the app bundle and extracted the apk for the device type. It contains the libjsc.so
file but not the libhermes.so
. Which imho is correct because my gradle is configured to not include it. The big question is why does it want to load it if it not enabled? What also surprised me is that I found libhermes-executor-release.so
and libhermes-executor-debug.so
in it too. Shouldn't they be excluded too? If you think it will make sense to bring this up in the react-native project, I will do so and link the issue here.
from hermes.
the relevant bit of code is here: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java#L288-L296 React Native tries to load JSC, and if it's not present, it tries to load Hermes. If the latter fails, you get the exception you're seeing.
Since you're building for JSC, the latter error is expected, but the first error is not. From your screen shot, libjscexecutor.so seems to be present, but the code is swallowing the error loading JSC, which is what would tell us what's wrong. I've asked someone here to improve the error reporting. In the interim, you could hack this code to comment out the try/catch. This will break enableHermes in the gradle files, but it should illuminate the problem.
One hypothesis is that the failing devices are not arm32, and the libraries for that platform are different.
I it makes sense to open an RN issue. I'm not sure what the problem is, but I suspect the fix will need to be in the react-native repo.
You're right that those hermes .so files should be excluded, but that's a separate problem.
from hermes.
Thanks for the more detailed report! A few other people have reported similar issues in facebook/react-native#25601 and running ./gradlew clean
has fixed it. Can you try that?
from hermes.
Our build pipeline does fresh checkouts removing all gradle caches programmatically and running gradle in a non-daemon mode.
rm -rf node_modules && rm -rf $TMPDIR/react-*
rm -rf $HOME/.gradle/caches
npm i
echo "Build Android"
bundle exec fastlane android build flags:--no-daemon --env=live
Shouldn't that be sufficient and not require us to run a ./gradlew clean
?
from hermes.
Something wrong with SoLoader.loadLibrary("jscexecutor");
private JavaScriptExecutorFactory getDefaultJSExecutorFactory(String appName, String deviceName) {
try {
// If JSC is included, use it as normal
SoLoader.loadLibrary("jscexecutor"); // something wrong with here
return new JSCExecutorFactory(appName, deviceName);
} catch(UnsatisfiedLinkError jscE) {
jscE.printStackTrace(); // something wrong with here
// Otherwise use Hermes
return new HermesExecutorFactory();
}
}
The crash is here facebook/react-native#25923 (comment)
I'm still trying to find the solution. -!!!
from hermes.
facebook/react-native#25986 (comment)
@Zloka
YES,but not work.
My project has used Jsc, and disable Hermes.
It OK in android 6.* 7.*
It has crashed in android 5.0
from hermes.
I don't really know a lot about fastlane and how it interacts with gradle, so I'm not knowledgeable enough to answer that. Perhaps someone else is, but you might be better off opening a react-native issue, since this seems more likely to be an issue with the react native build files than the hermes build files, and there are more people paying attention to these kinds of issues over there.
That said, the error you're seeing implies that the apk doesn't have a libhermes.so or a libjsc.so in it. Can you look at your apk, and see if either is there? If you're building without hermes, then libjsc.so should be in the apk, and if it's not, then that's the problem you'll need to understand and fix.
from hermes.
Is this related to this issue I am having with Hermes not working with (.abb) bundle releases?
https://github.com/facebook/hermes/issues/80
from hermes.
Not sure if it's relevant to you guys, but I ran into a somewhat similar issue where jsc wasn't being loaded. This comment might help: facebook/react-native#25986 (comment)
from hermes.
+1
from hermes.
@woshi82 Did you look into my comment into the other issue? facebook/react-native#25986 (comment)
from hermes.
Hi guys, I am receiving crashes and mostly from a user with android 6.0.1
and also, 7.1.1
, '5.1.1'
Also, l'm wondering if we can recreate this issue on debug mode, can we !!
from hermes.
Any news on this???. Crashes all over android 6.0 devices
from hermes.
Would be very nice to have a fix on that, I resorted to using APK instead of AAB, but now the app is 3x bigger.
from hermes.
I did a review of the issue using crashlytics. The problem seems to be on the emulator/dev devices. In my case, 100% of the events were tagged as a Nexus device using Andriod 6.0 (At this time, I was using the simulator).
Hope it helps
from hermes.
As observed above, this error will happen when JSC can't load, and Hermes is not enabled. I have landed a change in facebook/react-native@65d3167 to clarify the warning. I'll try to get this picked into RN 0.62, but for now I'm going to close this issue, in favor of reports based on the new code which will help us diagnose this better.
from hermes.
has same issue on android 4 when hermes is disabled
from hermes.
@Desintegrator minSdkVersion for react-native is 21 now, I doubt Android 4.x issues will see any attention at all.
from hermes.
@mikehardy is there any official announcement about that? RN repo says it supports sdk 16 or newer.
from hermes.
@Desintegrator See facebook/react-native@a17ff44 - it's happening in 0.64
from hermes.
There is a PR related to the error java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
: facebook/react-native#30749
The PR does not fix the real issue, but it fixes the error handling. Like many have said, the error about libhermes.so
is misguiding because the real issue must be something to do with JSC loading when Hermes is disabled.
from hermes.
Related Issues (20)
- Hermes should throw an exception when Maxium BigInt size exceed HOT 1
- simplifySwitchInst in SimplifyCFG ignores negative zero HOT 1
- iOS App submission will require a privacy manifest and signature HOT 6
- Possible memory leak HOT 30
- Compile failure with optimized ASan builds HOT 4
- Thread 6: "Exception NSException * "Unhandled JS Exception: Error: invalid host, js engine: hermes" HOT 32
- Parser: improve error message when await is used in non-async functions or instead of async
- JSRangeErrorException setting maximumFractionDigits to 0 with Intl.NumberFormat currency style HOT 1
- Unreachable in ES6 is reachable. HOT 1
- Update documentation on using custom Hermes builds HOT 3
- Building Static Hermes on Windows HOT 4
- Problems finding libraries with fresh compile under windows HOT 3
- Conversion of large array to a Set seems slow HOT 3
- React Native & Hermes: Is Additional Code Obfuscation Beneficial? HOT 1
- Array.protoype.indexOf() Performance Regression HOT 3
- 'hermes-engine' uses the unencrypted 'http' protocol to transfer the Pod.
- hermes-eslint missing `__defineGeneric` in context `getScope` HOT 1
- Date constructor accept wrong ISO 8601 date HOT 2
- libc.so (SIGABRT, SIGSEGV) HOT 4
- Performance regression traversing large arrays compared to other engines HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.