Skip to content

java.lang.UnsatisfiedLinkError dlopen failed: library "libhermes.so" not found #125

@waliahemanloop

Description

@waliahemanloop

Hi, some users of our app are facing this repetetive crash on production. Here is some of the information we have gathered about this crash so far -

  1. Our RN version is 0.72.8
  2. Around 0.1% of our users are facing this
  3. We do NOT have Hermes turned on, we are using JSC
  4. Attaching a screenshot of the stack trace of the crash from Firebase Crashlytics
  5. Based on the stack-trace, we have identified the function where we think the problem lies (attaching a snippet below), it's in the classReactInstanceManagerBuilder -> where hermes is being used as a fallback if loading JSC fails.

So the question now is, under what circumstances would loading JSC fail? And what can be done to fix this ? Any help or pointers in the right direction would be much appreciated.

`private JavaScriptExecutorFactory getDefaultJSExecutorFactory(String appName, String deviceName, Context applicationContext) {
if (this.jsEngineResolutionAlgorithm == null) {
FLog.w(TAG, "You're not setting the JS Engine Resolution Algorithm. We'll try to load JSC first, and if it fails we'll fallback to Hermes");

        try {
            ReactInstanceManager.initializeSoLoaderIfNecessary(applicationContext);
            JSCExecutor.loadLibrary();
            return new JSCExecutorFactory(appName, deviceName);
        } catch (UnsatisfiedLinkError var5) {
            if (var5.getMessage().contains("__cxa_bad_typeid")) {
                throw var5;
            } else {
                HermesExecutor.loadLibrary();
                return new HermesExecutorFactory();
            }
        }
    } else if (this.jsEngineResolutionAlgorithm == JSEngineResolutionAlgorithm.HERMES) {
        HermesExecutor.loadLibrary();
        return new HermesExecutorFactory();
    } else {
        JSCExecutor.loadLibrary();
        return new JSCExecutorFactory(appName, deviceName);
    }
}`
Screenshot 2024-03-27 at 10 23 10 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions