React-native: [CRASH] Android 6.0.1 crashes with java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so

Created on 2 Aug 2019  路  69Comments  路  Source: facebook/react-native

I uploaded a RN0.60.4 release build to Google Play and they ran automated tests leading to a lot of crashes coming in with the following stack trace:

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 738(SoLoader.java:738)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName + 591(SoLoader.java:591)
       at com.facebook.soloader.SoLoader.loadLibrary + 529(SoLoader.java:529)
       at com.facebook.soloader.SoLoader.loadLibrary + 484(SoLoader.java:484)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit> + 20(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create + 27(HermesExecutorFactory.java:27)
       at com.facebook.react.ReactInstanceManager$5.run + 949(ReactInstanceManager.java:949)
       at java.lang.Thread.run + 818(Thread.java:818)

Affected OS is always 6.0.1. Interestingly Hermes is not even enabled in my build.gradle:

project.ext.react = [
  entryFile: "index.android.js",
  enableHermes: false,  // clean and rebuild if changing
  bundleInDebug: false,
  bundleInRelease: true,
  root: "../../",
 ]
...
def enableHermes = project.ext.react.get("enableHermes", false);
...
// Hermes config
    if (enableHermes) {
      def hermesPath = "../../node_modules/hermesvm/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
      implementation jscFlavor
    }

I looked into the app bundle and extracted the apk for the device type that is crashing. It contains the libjsc.so file but not the libhermes.so. Imho this 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. I guess, they should be excluded?

I filed a report with the Hermes project here but they referred me to here.

React Native version:

System:
    OS: macOS 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 88.63 MB / 32.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      API Levels: 23, 26, 27, 28
      Build Tools: 23.0.1, 25.0.0, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3
      System Images: android-24 | Google APIs Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-native: ^0.60.4 => 0.60.4
  npmGlobalPackages:
    eslint-plugin-react-native: 3.5.0
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. Upload an RN0.60.4 app bundle with crash reporting to Playstore
  2. check the crash reports

Describe what you expected to happen:

  • The Google Play devices should not crash.
  • Hermes library should not be loaded if disabled.
  • libhermes-executor-release.so and libhermes-executor-debug.so should not get bundled
Bug Hermes Android

Most helpful comment

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

All 69 comments

I think this is related to my issue I posted on the Hermes repo.

https://github.com/facebook/hermes/issues/80

I am not so sure, because I did not even have Hermes activated because I was experiences issues even building it. However, the devices that run the app crash because they try to load it but it is not bundled (as configured).

I'm having occasional crashes like this in production with hermes disabled also on 0.60.4

I am also having similar crashes as described here but WITH having hermes enabled as described wtihin https://github.com/facebook/hermes/issues/76 .
Any idea why that might be happening?

Having this issue too, when hermes disabled.

RN: 0.60.4

Device
Brand: LGE
Model: Nexus 5X
Orientation: Portrait
RAM free: 3.3 GB
Disk free: 2.06 GB

Operating System
Version: 6.0.1
Orientation: Portrait
Rooted: Yes

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 738(SoLoader.java:738) at com.facebook.soloader.SoLoader.loadLibraryBySoName + 591(SoLoader.java:591) at com.facebook.soloader.SoLoader.loadLibrary + 529(SoLoader.java:529) at com.facebook.soloader.SoLoader.loadLibrary + 484(SoLoader.java:484) at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit> + 20(HermesExecutor.java:20) at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create + 27(HermesExecutorFactory.java:27) at com.facebook.react.ReactInstanceManager$5.run + 949(ReactInstanceManager.java:949) at java.lang.Thread.run + 818(Thread.java:818)

same problem in 5.1.1

anyone fixed it?

issue
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so

use version 0.60.0

I got the same problem if I integrate my react-native-app to an existing android-app. I use react-native-version 0.60.4.
I documentated my code there: https://github.com/facebook/react-native/issues/25985

Edit: I could fix my problem. Maybe it helps you. ->https://github.com/facebook/react-native/issues/25985

Having the same issue, the project works fine on my local emulator but it gives the exact same error
with @wsdt , any solutions yet?

How is react 60 stable I don't understand.

I have had crashes for
Device
Brand: LGE
Model: Nexus 5X
React Native Version: 0.60.3
Android Version: 6.0.1

I had created android app bundle( .aab file ) with hermes enabled. I have only debug and release variant. release variant has this problem.
Issue is opened on Aug 3 and it's been so many days, not a single working fix is available. Really frustrating.

Hey @arjun-livquik you will need to build apk if you plan to have hermes enabled as its not currently compatible with app bundles.

https://github.com/facebook/react-native/issues/25927

Thanks @owinter86
Could be that app might work just fine with APKs, because I have submitted APKs for staging build and had never seen this crash.
Sure will use APKs instead.

Hello.

Have you tried with the latest release of Hermes?
https://github.com/facebook/react-native/issues/25646#issuecomment-527116145

Of course, the "sdk<=19" problem does not apply to you, but there were lots of other fixes to Hermes too.
BTW, I built and submitted .aab release builds with hermes to the Play Store, and they haven't had any problems.

Also, be sure to clean the android build folders (I usually build with "./gradlew clean assembleRelease bundleRelease", just in case) if you change the "hermes enabled/disabled" setting.

Cheers!

@jsaraiva Ofcourse I run ./gradlew clean bundleRelease everytime for creating .aab file. I have now rolled out to Alpha with all the APKs along with universal apk for now.

"couldn't find DSO to load: libhermes.so "
React Native Version: 0.61.2
enableHermes: false
Still facing this issue

received from crashlytics

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java)
       at com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java)
       at com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java)
       at com.facebook.soloader.SoLoader.assertInitialized(SoLoader.java)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java)
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java)
       at java.lang.Thread.run(Thread.java:760)
Brand: Xiaomi
Model: Redmi 4X
Orientation: Portrait
RAM free: 1.49 GB
Disk free: 18.04 GB
Version: 7.1.2
Orientation: Portrait
Rooted: No

I'm seeing this crash in production with RN 0.61.2, using android bundles with hermes disabled, only on android 6 LGE devices.

I am also seeing this crash in production with RN 0.61.2, using android bundles with hermes disabled, on google nexus 5x

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:952)
       at java.lang.Thread.run(Thread.java:818)
Brand: LGE
Model: Nexus 5X
Orientation: Portrait
RAM free: 3.12 GB
Disk free: 218.66 MB
Operating System
Version: 6.0.1
Orientation: Portrait
Rooted: Yes

I was able to resolve it with a ./gradlew clean in the /android folder.

I am also seeing this crash in production with RN 0.61.2, using android bundles with hermes disabled, on google nexus 5x

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
       at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:952)
       at java.lang.Thread.run(Thread.java:818)
Brand: LGE
Model: Nexus 5X
Orientation: Portrait
RAM free: 3.12 GB
Disk free: 218.66 MB
Operating System
Version: 6.0.1
Orientation: Portrait
Rooted: Yes

I have the same issue with the same version of android.

My Crashlytics report:

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
at com.facebook.hermes.reactexecutor.HermesExecutor.(HermesExecutor.java:20)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:952)
at java.lang.Thread.run(Thread.java:818)

Device
Brand: LGE
Model: Nexus 5X
Orientation: Portrait
RAM free: 3.18 GB
Disk free: 495.84 MB
Operating System
Version: 6.0.1
Orientation: Portrait
Rooted: Yes
Crash
Date: Nov 5, 2019, 5:05:00 PM
App version: 2.3.2 (2320)

Same issues on Android 6.0.1
Any solution?

Any workaround for this issue, I'm trying to run a beta release on Google play and this crash shows in Crashlytics

I met the same issue and solved by this .

@Symous I have same config in the answer and the maven repo but still I have the issue.

I have React-native 0.60.5 and I'm not migrating from other versions, it's a new project.

Btw hermes is disabled in my build.gradle but still got this error.

Edit:
I will try this solution

Same issue as well, RN 0.61.2, hermes disabled, seeing the same crashes reported for Nexus 5X 6.0.1 after uploading the app bundle to Play Store alpha track. Interestingly enough, Robo tests on Firebase Test lab are successful for Nexus 5 (physical device with android 6.0.1) and Nexus 5X (virtual device with android 6.0.1). Has anybody managed to reproduce this on any physical device?

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();
    }
  }

I'm still trying to find the solution. -!!!

The real crash is

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: cannot locate symbol "__cxa_bad_typeid" referenced by "libjsc.so"...

111-15 17:31:41.427 372-372/com.**.** W/System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: cannot locate symbol "__cxa_bad_typeid" referenced by "libjsc.so"...
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.**.**.MainActivity$4.getJavaScriptExecutorFactory(MainActivity.java:879)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:73)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.**.**.MainActivity.initReactNative(MainActivity.java:951)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.**.**.MainActivity.onCreate(MainActivity.java:2737)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.Activity.performCreate(Activity.java:6186)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2388)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2508)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.ActivityThread.access$900(ActivityThread.java:165)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.os.Looper.loop(Looper.java:179)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5509)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:961)
11-15 17:31:41.427 372-372/com.**.** W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

You guys may find this https://github.com/facebook/react-native/issues/25986#issuecomment-520424504 relevant.

@woshi82 that probably may be related with https://github.com/android/ndk/issues/408

Keep getting the same error in spite of disabling Hermes. My react-native version is 0.61.2

same here, react-native 0.61.4

Same issue:

React Native: 0.61.5
Brand: LGE
Model: Nexus 5X
SO: 6.0.1

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

com.facebook.soloader.SoLoader.doLoadLibraryBySoName (SoLoader.java)
com.facebook.soloader.SoLoader.assertInitialized (SoLoader.java)
com.facebook.soloader.SoLoader.assertInitialized (SoLoader.java)
com.facebook.soloader.SoLoader.assertInitialized (SoLoader.java)
com.facebook.hermes.reactexecutor.HermesExecutor.<clinit> (HermesExecutor.java)
com.facebook.hermes.reactexecutor.HermesExecutorFactory.create (HermesExecutorFactory.java)
com.facebook.react.ReactInstanceManager$5.run (ReactInstanceManager.java)
java.lang.Thread.run (Thread.java:818)

Android build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()

        maven {
           url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.2")
        classpath 'com.google.gms:google-services:4.3.3'

        // Add dependency
        classpath 'io.fabric.tools:gradle:1.31.2'  // Crashlytics plugin

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenLocal()
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

android/app/build.gradle

apply plugin: "com.android.application"
apply plugin: 'io.fabric'

crashlytics {
  enableNdk true
}

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = true
def enableProguardInReleaseBuilds = true
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 5
        versionName "1.0.2"
        missingDimensionStrategy 'react-native-camera', 'general'
        multiDexEnabled true              
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        debug {
            storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['debugKeyStore'])
            storePassword keystoreProperties['debugStorePassword']
            keyAlias keystoreProperties['debugKeyAlias']
            keyPassword keystoreProperties['debugKeyPassword']
        }
        release {
            keyAlias keystoreProperties['releaseKeyAlias']
            keyPassword keystoreProperties['releaseKeyPassword']
            storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore'])
            storePassword keystoreProperties['releaseStorePassword']
        }                
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }

        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'

+1
RN Version: 0.60.4
Release Method: signed Bundle

Rolled back to signed APK now.

Having this issue in RN version 0.61.4. Is the only option to move to an APK? Cannot find a solution for this issue? Thanks

We are getting this error everytime we want to do a --variant=release build after doing a debug one. Doing /gradlew clean fixes it.

Still happening to production users randomly on 0.61.5 with Hermes disabled building as a bundle.

For me rolled back to APK works but because I was dissatisfied with it, decided to investigate.

I "solved" (not sure but the error didn't pop during googleplay pre-launch reports) the issue by forcing a specific version of soLoader

in build.gradle

android {
    defaultConfig {
      // let your old config
        ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
       }
    }
}

I also made a stackoverflow question , maybe we can get more help from the community.

I had the same issue and was because I forget to update the (app/android)/buld.gradle, as say the documentation, I checked the changes with https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.61.5 and updated those files, also check the other files, but the important part is

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

We are getting this error everytime we want to do a --variant=release build after doing a debug one. Doing /gradlew clean fixes it.

Just to make sure this does not confuse anyone - our error was actually:

java.io.UncheckedIOException: java.io.FileNotFoundException: .../android/app/build/intermediates/transforms/stripDebugSymbol/release/0/lib/x86_64/libhermes-executor-release.so (No such file or directory)

Not exactly the one that is mentioned in the subject. It also only happened on build time, not runtime. We believe it might have been solved after deleting the /android/.gradle folder and re-building but need to do more tests.

/android/gradlew clean told me clean was undefined for some reason. Manually deleting the /android/.gradle folder and rebuilding fixed it for me.

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

I added this in project gradle: it fixed my problem

allprojects { repositories { google() mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } maven { url 'https://maven.google.com' } } }

same for me

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

Awesome. This fixed it for us 馃挭

But sadly this isn't in React Native 0.62.2 as I discovered the issue after upgrading to it.
The v0.63.0-rc.1 however already contains it , so I guess it will come soon.

As it is in the master here already I guess it is considered safe to upgrade the soloader to 0.8.2.
Did anyone experience any issue because of it so far?

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

In which file do you apply this edit?

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

In which file do you apply this edit?

I've added it somewhere in the middle of the large android block of the android/app/build.gradle

same here, react-native 0.62.2

Upgraded my react native version to the 63 rc1 and forced soloader 8.2. I checked the package version number of the SoLoader.java:825 and see that its correctly 8.2. Still getting the issue :/

Upgraded my react native version to the 63 rc1 and forced soloader 8.2. I checked the package version number of the SoLoader.java:825 and see that its correctly 8.2. Still getting the issue :/

With 8.2 I was getting crashes on Android 4 and, if I remember correctly, Android 5. I updated to 9.0 and most of these crashes are gone, however I still experience a minimal amount of crashes related to soloader.

For me this issue was due to SoLoader.loadLibrary("jscexecutor");
Debugging more into it i found its due to couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libgnustl_shared.so" not found

Finally i arrived at below solution which fixed my issue.
replacingimplementation jscFlavor with implementation "org.webkit:android-jsc:r245459" where jscFlavor=org.webkit:android-jsc:+ in app's gradle file

Important info if you use Hermes
I updated from 61.5 to 62.2 and got a crash on android:
couldn't find DSO to load: libhermes-executor-debug.so

I fixed it by adding following string to android/app/build.gradle:
_implementation "org.webkit:android-jsc:+"_

Important info if you use Hermes
I updated from 61.5 to 62.2 and got a crash on android:
couldn't find DSO to load: libhermes-executor-debug.so

I fixed it by adding following string to android/app/build.gradle:
_implementation "org.webkit:android-jsc:+"_

can confirm this make my app apk size increase 10+MB and crash on all the devices

Upgraded to RN 0.62.2 and have the below crash in production

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
at com.facebook.hermes.reactexecutor.HermesExecutor.(HermesExecutor.java:20)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:997)
at java.lang.Thread.run(Thread.java:818)

Brand: Xiaomi
Model: Mi 9X
Orientation: Portrait
RAM free: 19.19 GB
Disk free: 14.78 GB
Operating System
Version: 5.1
Orientation: Portrait
Rooted: Yes
Date: Jun 22, 2020, 10:44:00 PM

Have this in my android/build.gradle
maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") }

Any help on this would he really helpull.

How is react 60 stable I don't understand.

I have had crashes for
Device
Brand: LGE
Model: Nexus 5X
React Native Version: 0.60.3
Android Version: 6.0.1

I had created android app bundle( .aab file ) with hermes enabled. I have only debug and release variant. release variant has this problem.
Issue is opened on Aug 3 and it's been so many days, not a single working fix is available. Really frustrating.

Were you able to solve the issue. I'm also facing the same issue in version 0.61.5

Same issue none of the above solutions worked for me still a crash on Nexus5 6.0.1

It worked for me in RN version 0.62.2 by adding to android/app/build.gradle:

implementation 'com.facebook.soloader: soloader: 0.9.0+'

I can confirm I'm still having this issue with React-Native 0.62.2 though I haven't tried making any changes to my build.gradle yet.

What I can offer is this stack overflow that appears to show how to reproduce the issue: https://stackoverflow.com/questions/61544046/android-java-lang-unsatisfiedlinkerror-couldnt-find-dso-to-load

I'm uncertain at the moment which of the many fixes proposed above seems to be best. There are also many fixes presented on a similar issue here: https://github.com/facebook/SoLoader/issues/55.

Has anyone found a solution that reliably works for everyone (running /gradlew clean does not seem to work for everyone).

I can confirm I'm still having this issue with React-Native 0.62.2 though I haven't tried making any changes to my build.gradle yet.

What I can offer is this stack overflow that appears to show how to reproduce the issue: https://stackoverflow.com/questions/61544046/android-java-lang-unsatisfiedlinkerror-couldnt-find-dso-to-load

I'm uncertain at the moment which of the many fixes proposed above seems to be best. There are also many fixes presented on a similar issue here: facebook/SoLoader#55.

Has anyone found a solution that reliably works for everyone (running /gradlew clean does not seem to work for everyone).

Personally, I never found a solution so I changed my minimum requirement version. At the time we had 10 people (testers) on the app at this time, none of them reported a crash, so I have a feeling it is google running an automated test when they put it through review. The version of android that is crashing is so old, I really felt it was not worth supporting in the end (after spending 2 days trying to fix it).

@hannahcx do you think they could have also tried this on multiple other versions? I'm having crashes on versions from 7 - 10 but it's only for 4 users total.

And I'm leaning towards punting on this issue as it's less than 0.5% of users and seems to be very complex.

@jimmyceroneii After trying many, many solutions from around github/SO, the link you provided is what solved it for me.

https://stackoverflow.com/questions/61544046/android-java-lang-unsatisfiedlinkerror-couldnt-find-dso-to-load

EDIT: I also used soLoader version 0.9.0 instead of 0.8.2. Possibly due to using RN version 0.63.2

Fixed with changing SoLoader version to 0.8.2 according to 0.62 react-native configuration.
https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties

    configurations.all {
        resolutionStrategy {
            force "com.facebook.soloader:soloader:0.8.2"
        }
    }

For me adding this piece of code and also executing "./gradlew clean" command in android folder combinedly fixed the issue.

RN 0.62.2 here with hermes enabled. For me adding

configurations.all { resolutionStrategy { force "com.facebook.soloader:soloader:0.8.2" } }

to my top-level build.gradle and

implementation "com.facebook.soloader:soloader:0.8.2"

as well as

ndk { abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" }

to my app-level build.gradle did the trick. I think that especially the latter made the difference as before both apk's and aab's showed an additional (fifth) lib folder armeabi which did not contain all lib files, in particular not libhermes.so.

Hello,
I have the same worries, I've been going around in circles for several weeks because of hermes, I'm depressed: /

SoLoader: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/com.test/lib-main/libhermes-inspector.so". .. result: 0
2020-11-03 11: 09: 53.512 16167-16270 / com.test E / SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: couldn't find DSO to load: libhermes-inspector .so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/com.test/lib-main/libhermes-inspector.so" ... result: 0 result: 0
2020-11-03 11: 09: 53.558 16167-16272 / com.test A / libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffffffff in tid 16272 (mqt_js), pid 16167 (com.test )

Can somebody help me please ?

this problem occurred while I upgrading from 0.59.4 to 0.61.0

in android/app/build.gradle
I've added

project.ext.react = [
    //...
    enableHermes: true
]

def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);

and

dependencies {
    //...
    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
    //...
}

and it works :)
hope this solution is useful for someone
image

This is because SOLoader is absent.

Ensure

implementation'com.facebook.soloader:soloader:0.9.0+'

is added under dependencies in android/app/build.gradlle

clean your build
cd android
./gradlew clean

Try bundling
./gradlew bundleRelease

Exit android folder
cd ../

Try running
npx react-native run-android --variant=release

@Michaelvons nice one 馃憤 ... but did you know why ? i have this probleme just with the last Android sdk 11 (Level 30)

Hello, could someone explain this error to me and tell me how to resolve it please?

DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0

I use the react-native-jitsi-meet library

Thank you

Was this page helpful?
0 / 5 - 0 ratings