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

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

.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

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

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.