[Android] Couldn't find DSO to load crash in release build and hermes is enabled
See original GitHub issueDescription
Hermes is enabled with following packaging options in android.
packagingOptions { if (enableHermes) { // For Hermes, delete all the libjsc* files exclude "/libjsc*.so" if (taskName.contains(“Release”)) { // Reduce size by deleting the debugger/inspector exclude '/libhermes-inspector.so’ exclude ‘/libhermes-executor-debug.so’ } else { // Release libs take precedence and must be removed // to allow debugging exclude '/libhermes-executor-release.so’ } } else { // For JSC, delete all the libhermes* files exclude “**/libhermes*.so” } }
Getting this crash on release build.
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so caused by: couldn't find DSO to load: libreactnativejni.so caused by: ELF file truncated result: 0 result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:918)
at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:740)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:654)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:634)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:582)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:25)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1066)
at java.lang.Thread.run(Thread.java:923)
Version
0.66.0
Output of npx react-native info
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn’t find DSO to load: libhermes-executor-release.so caused by: couldn’t find DSO to load: libreactnativejni.so caused by: ELF file truncated result: 0 result: 0 at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:918) at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:740) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:654) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:634) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:582) at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:25) at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29) at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1066) at java.lang.Thread.run(Thread.java:923)
Steps to reproduce
N/A
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:34 (4 by maintainers)
https://github.com/facebook/react-native/issues/25537#issuecomment-1182498993
This worked for me
@cortinico
This is also happening in my Android environment. I’m working on bumping from 0.63.2 to 0.67.1, and the application in the release build crashes immediately before the splash screen.
Multiple logs of
couldn't find DSO to load
can be seen in the adb log output. An excerpt is below.Logs
02-22 18:00:04.412 9890 9890 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so 02-22 21:42:28.406 3548 3548 E SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found result: 0 02-22 21:48:22.995 4603 4603 E SoLoader: couldn't find DSO to load: libjscexecutor.so 02-22 21:48:23.033 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.034 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.034 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-common-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/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 02-22 21:48:23.034 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-common-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/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 02-22 21:48:23.034 4603 4603 W System.err: Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 02-22 21:48:23.035 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: couldn't find DSO to load: libhermes-executor-common-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/jp.exampleapp.canary/lib-main/libhermes-inspector.so"... result: 0 result: 0 result: 0 02-22 21:48:23.035 4603 4603 E SoLoader: couldn't find DSO to load: libhermes-executor-release.so 02-22 21:48:23.036 4603 4603 W System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so 02-22 21:48:23.036 4603 4603 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.sonpx react-native info
System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Pro Memory: 99.73 MB / 16.00 GB Shell: 3.3.1 - /opt/homebrew/bin/fish Binaries: Node: 14.18.2 - ~/.asdf/installs/nodejs/14.18.2/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 6.14.15 - ~/.asdf/plugins/nodejs/shims/npm Watchman: 2022.01.24.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 29, 30, 32 Build Tools: 28.0.3, 29.0.2, 30.0.2, 32.0.0 System Images: android-31 | Google APIs ARM 64 v8a, android-32 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7935034 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_312 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.1 => 0.67.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
#33065, #33079 also looks like a very similar Issue. However, each seems to have a different version of RN. Is there a widespread impact on the release build?
※This problem did not occur in the debug build