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 crashes when booting on 0.68.0-rc.2 when hermes enabled

See original GitHub issue

Description

When updating to the new version the app crashes on start. I have hermes enabled. I get the following log

2022-03-11 10:47:27.653 24788-24788/com.jurishand.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.jurishand.app, PID: 24788
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found result: 0
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1098)
        at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:914)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:826)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:773)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:743)
        at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24)
        at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:20)
        at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24)
        at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:351)
        at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:318)
        at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:95)
        at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
        at com.jurishand.app.MainApplication.onCreate(MainApplication.java:71)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
        at android.app.ActivityThread.access$1300(ActivityThread.java:219)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found
        at java.lang.Runtime.load0(Runtime.java:938)
        at java.lang.System.load(System.java:1631)
        at com.facebook.soloader.SoLoader$1.load(SoLoader.java:529)
        at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:110)
        at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:63)
        at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:91)
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1038)


I tried a solution that worked and the app works correctly

in android/build.gradle add

maven {
  url("$rootDir/../node_modules/jsc-android/dist")
}

in android/app/build.gradle add

if (useIntlJsc) {
   implementation 'org.webkit:android-jsc-intl:+'
} else {
   implementation 'org.webkit:android-jsc:+'
}   

however the const isHermes = () => !!global.HermesInternal; returns false

Version

0.68.0-rc.2

Output of npx react-native info

System: OS: Windows 10 10.0.22000 CPU: (8) x64 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz Memory: 1.89 GB / 15.73 GB Binaries: Node: 16.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 23, 28, 29, 30, 31 Build Tools: 28.0.2, 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0 System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8092744 Visual Studio: Not Found Languages: Java: 11.0.12 npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0-rc.2 => 0.68.0-rc.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Update RN from 0.66.4 to 0.68.0-rc.2

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

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RalissonMattiascommented, Mar 14, 2022

@cortinico I found the problem

This code snippet was at the top of my file

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

Doing this on my android/app/build.gradle resolves my problem

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
1reaction
RalissonMattiascommented, Mar 12, 2022

I will do more tests and compare the two versions

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Maps when it crashes - Android - Google Maps Help
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >
Enabling hermes in android app crashing app in react native ...
Enabling Hermes in react native giving below error without hermes ... When we try to build below code its crashing RN - 0.68.3...
Read more >
App crashes after using useQuery or Realm.objects()
When I perform a query to list the data that are in the database through the useQuery(MyModel) command, the data is apparently loaded...
Read more >
Using Hermes - React Native
For many apps, using Hermes will result in improved start-up time, ... to enable Hermes on Android or 0.64 of React Native to...
Read more >
Rescue Party | Android Open Source Project
Rescue Party is enabled by default in Android 8.0, ... Rescue Party receives information about boot and crash events and starts if:.
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