question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android crashing RN (0.69.4) libhermes-executor-release.so

See original GitHub issue

Description

I updated to react-native 0.69.4. Now Android is crashing but only for certain variant types. I have 4 of them (debug, canary, beta and release). debug and release work fine but canary and beta give the following error on application startup. Maybe work mentioning is that I use expo-modules-core if that makes any difference.

09-13 13:31:26.675 20708 20708 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-release.so

Version

0.69.4

Output of npx react-native info

System:
    OS: macOS 12.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 240.58 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    Watchman: 2022.09.05.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: javac 17 - /Users/mrados/.jabba/jdk/openjdk@1.17.0/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.4 => 0.69.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

hermes -> enabled build.gradle

	dependencies { 
	      implementation 'com.facebook.soloader:soloader:0.10.4+'
	  
	  
	      if (enableHermes) {
	          implementation("com.facebook.react:hermes-engine:+") {
	              exclude group: 'com.facebook.fbjni'
	          }
	      } else {
	          implementation jscFlavor
	      }
	}

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

.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
sidferreiracommented, Sep 19, 2022

@mrados7 we have a staging variant, so I totally get the struggle

1reaction
cortinicocommented, Sep 15, 2022

I’m wondering now is it possible that in my case it’s looking for libhermes-executor-canary.so instead of libhermes-executor-release.so. Maybe it should be built like libhermes-executor-{variant}.so. Maybe I’m talking nosense now but I don’t know what are the reasons of release and debug working normally but other variants are not.

The problem here is in the logic in place to remove the .so files from the final APKs.

You should be able to solve this by specifying a custom deleteDebugFilesForVariant in your build.gradle such as:

project.ext.react = [
   bundleInStaging: true,
   devDisabledInStaging: true,
   enableHermes: true,  // clean and rebuild if changing
+  deleteDebugFilesForVariant: {
+    def variant -> variant.name.toLowerCase().contains("release") || variant.name.toLowerCase().contains("canary") ||
variant.name.toLowerCase().contains("beta")
+  }
]

We’re looking into potentially changing this approach in the future as it’s really brittle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Native :java.lang.UnsatisfiedLinkError: couldn't find ...
I added this block in allProject block in project_dir/build.gradle and the crash went away. maven { // Android JSC is installed from npm ......
Read more >
Fix an Android device that's restarting or crashing
Try the following steps if your phone has any of these problems: Randomly reboots or restarts Shuts down without restarting Restarts constantly: Go...
Read more >
Why are my Android phone apps crashing or closing & how ...
Find out why your Samsung Galaxy Android phone apps keep crashing, closing, freezing or stop working. Fix the issue with our guide and...
Read more >
Why do my apps keep crashing on Android, How to fix it
As a result, apps can sometimes end up crashing on Android , more so when compared to iOS. Why do apps freeze or...
Read more >
Detect and diagnose crashes
An app that is written using Java or Kotlin crashes if it throws an ... The type of exception thrown is usually a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found