react-native: Android App Crash: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so

Description

W/SoLoader: libjscexecutor.so not found on DirectAPKSoSource: 4
    java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__cxa_bad_typeid" referenced by "/data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/base.apk!/lib/arm64-v8a/libjsc.so"...
        at java.lang.Runtime.load0(Runtime.java:939)
        at java.lang.System.load(System.java:1628)
        at com.facebook.soloader.SoLoader$1.load(SoLoader.java:529)
        at com.facebook.soloader.DirectApkSoSource.loadLibrary(DirectApkSoSource.java:77)
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1038)
        at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:914)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:826)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:773)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:743)
        at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24)
        at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:20)
        at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:29)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1112)
        at java.lang.Thread.run(Thread.java:923)
D/SoLoader: libjscexecutor.so not found on /system/lib64
D/SoLoader: libjscexecutor.so not found on /vendor/lib64
E/SoLoader: couldn't find DSO to load: libjscexecutor.so
    	SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/lib/arm64 flags = 0]
    	SoSource 1: com.facebook.soloader.DirectApkSoSource[root = /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/base.apk!/lib/arm64-v8a]
    	SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
    	SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
    	Native lib dir: /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/lib/arm64
     result: 0
E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.my.app, PID: 17137
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
    	SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/lib/arm64 flags = 0]
    	SoSource 1: com.facebook.soloader.DirectApkSoSource[root = /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/base.apk!/lib/arm64-v8a]
    	SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
    	SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
    	Native lib dir: /data/app/~~PKlY1zxnY1I_9g3kewPBDA==/com.my.app-oPmcKhUyEBL8mkHRwrWxJA==/lib/arm64
     result: 0
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1098)
        at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:914)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:826)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:773)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:743)
        at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24)
        at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:20)
        at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:29)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1112)
        at java.lang.Thread.run(Thread.java:923)

Version

tried multiple versions (0.69 / 0.68.2 / 0.62 / 0.59.8 / 0.58.5)

Output of npx react-native info

info Fetching system and libraries information… System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Memory: 100.92 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.3.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.11.0 - /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: Not Found SDKs: iOS SDK: Not Found Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 18.0.1.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found info React Native v0.69.0 is now available (your project is running on v0.68.2). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.69.0. info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.68.2. info To upgrade, run “react-native upgrade”. npm notice npm notice New minor version of npm available! 8.11.0 -> 8.13.1 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.13.1 npm notice Run npm install -g npm@8.13.1 to update! npm notice

Steps to reproduce

it crashes during initialization, can reproduce the crash every time

Snack, code example, screenshot, or link to a repository

it crashes from the Jitsi Android SDK, jitsi SDK github repo: https://github.com/jitsi/jitsi-meet

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 20 (4 by maintainers)

Most upvoted comments

any solution on this, facing same problem in 0.69.

facing same issue.

this helped me, but I think you meant this?

import com.facebook.hermes.reactexecutor.HermesExecutor;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
...
// inside ReactNativeHost
        @Override
        protected JavaScriptExecutorFactory getJavaScriptExecutorFactory() {
            HermesExecutor.loadLibrary();
            return new HermesExecutorFactory();
        }

I am barely a java novice, but this did get rid of this error for me. thank you.

Same issue in RN 0.7.20. In this version Hermes is mandatory.

This and all the “couldn’t find DSO to load” bugs have been fixed in React Native 0.71.

The issue on previous versions was a “too aggressive” clean-up logic in the react.gradle file. In 0.71 the clean-up logic has been rewritten to be more Android friendly and is now living inside the React Native Gradle Plugin.

I’m closing this, please update to 0.71 and open a new issue if the “couldn’t find DSO to load” crash is still happening on 0.71+.