React Native error with couldn't find DSO to load: libhermes.so
Issue
In the React Native 0.62.2 project, I generate an Android release apk, and when it runs on Android emulat or some Android devices, it gets crashed after launch screen. I get the following error logs:
FATAL EXCEPTION: create_react_context
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.<clinit>(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:770)
Solution
Modify the dependencies
block of android/app/build.gradle
, add or upgrade the SOLoader dependency, as follows.
dependencies {
implementation'com.facebook.soloader:soloader:0.9.0+'
}