react-native
react-native copied to clipboard
couldn't find DSO to load: libhermes-executor-debug.so after upgrading from RN 0.65.0 to 0.70.4
Description
After upgrading RN project from 0.65.0 to 0.70.4 I end up in a problem with crashing app on start. The error appears in both debug and release build but in release build error cause app to freeze on splash screen. I tried all available solutions online but nothing didn't help.
Build.gradle:
project.ext.react = [
enableHermes: true,
enableVmCleanup: false,
]
apply from: '../../node_modules/react-native/react.gradle'
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = true
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get('enableHermes', true)
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
My dependencies:
dependencies {
implementation platform('com.google.firebase:firebase-bom:28.4.0')
implementation 'com.facebook.soloader:soloader:0.10.4+'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.work:work-runtime-ktx:2.7.0'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:' // From node_modules
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
implementation project(':react-native-config')
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
huaweiImplementation 'com.huawei.hms:hianalytics:6.3.0.302'
if (enableHermes) {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
}
Version
0.70.4
Output of npx react-native info
System: OS: macOS 12.6.1 CPU: (10) arm64 Apple M1 Pro Memory: 101.31 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: Not Found npm: 7.21.1 - ~/projects/uc-chameleon-nova-portal-app/node_modules/.bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /Users/urosuzelac/.rvm/gems/ruby-2.7.5/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: 11.0.16.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.4 => 0.70.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
After starting the app there is just Splash Screen in freezed state. This happens only in release build. In debug build error is just shown in Logcat.
Snack, code example, screenshot, or link to a repository
couldn't find DSO to load: libhermes-executor-debug.so SoSource 0: com.facebook.soloader.a[root = /data/data/com.ucnewsportal/lib-main flags = 1] SoSource 1: com.facebook.soloader.d[root = /data/app/com.ucnewsportal-sPK_xK9tZWkhxvAZOwVmJA==/lib/arm64 flags = 0] SoSource 2: com.facebook.soloader.d[root = /system/lib64 flags = 2] SoSource 3: com.facebook.soloader.d[root = /vendor/lib64 flags = 2] Native lib dir: /data/app/com.ucnewsportal-sPK_xK9tZWkhxvAZOwVmJA==/lib/arm64 result: 0
i am having the same problem. :(
Me Too
The only thing that worked for me was disabling Hermes in app/build.gradle
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
I fixed it by making changes in the implementation of react-native in build.gradle file.
By default, it was like this
implementation "com.facebook.react:react-native:+" // From node_modules
I changed it to,
implementation ("com.facebook.react:react-native") version {
strictly "0.63.2" // pass in your react-native version
}
After long process of trial and error, we finally found out what was causing Android realise build to freeze at start up. It was babel-plugin-minify-dead-code-elimination
that we were using in our project.
In our babel.config.js
file there was this plugin enabled
env: {
production: {
plugins: [['minify-dead-code-elimination', { optimizeRawSize: true }]],
},
}
after upgrading babel-plugin-minify-dead-code-elimination
from 0.5.1
to 0.5.2
we finally managed to build our Android realise build successfully.
I hope that this will help someone upgrading from RN 0.65.0
to newer version and save a lot of hours of searching for
the solution.
About libhermes-executor-debug.so
, this actually will not cause your app stop working. You can try realise
build with new clean project and you will see the same error message. If your app is not working it is not up to libhermes-executor-debug.so
it is something else.
Happy hacking!
--------- beginning of crash
11-19 16:48:33.038 10319 10319 E AndroidRuntime: FATAL EXCEPTION: main
11-19 16:48:33.038 10319 10319 E AndroidRuntime: Process: com.a07061, PID: 10319
11-19 16:48:33.038 10319 10319 E AndroidRuntime: com.facebook.react.uimanager.IllegalViewOperationException: No ViewManager found for class RCTText
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.uimanager.ViewManagerRegistry.get(ViewManagerRegistry.java:68)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.mounting.SurfaceMountingManager.createViewUnsafe(SurfaceMountingManager.java:857)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.mounting.SurfaceMountingManager.preallocateView(SurfaceMountingManager.java:1250)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.mounting.mountitems.PreAllocateViewMountItem.execute(PreAllocateViewMountItem.java:63)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(MountItemDispatcher.java:351)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchPreMountItems(MountItemDispatcher.java:330)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1248)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.fabric.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:796)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:727)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7656)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
11-19 16:48:33.038 10319 10319 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
11-19 16:48:33.039 511 1513 W ActivityTaskManager: Force finishing activity com.a07061/.MainActivity
11-19 16:48:33.039 511 10349 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
11-19 16:48:33.043 313 369 D goldfish-address-space: claimShared: Ask to claim region [0x3f74fc000 0x3f7aff000]
The app keeps crashing like this on first boot.
And sometimes: requireNativeComponent: "RCTView" was not found in the UIManager
The only thing that worked for me was disabling Hermes in app/build.gradle
project.ext.react = [ enableHermes: false, // clean and rebuild if changing ]
That worked for me! Thanks
How to fix it?