-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native app using Hermes crashes on Android 4.4 #68
Labels
duplicate
This issue or pull request already exists
Comments
Just noticed there was a duplicate issue at #42 |
Closed
mganandraj
pushed a commit
to mganandraj/hermes
that referenced
this issue
Jun 22, 2022
Currently it is not possible to clone the hermes-windows repo and build the code using CMake inside VS Code. The reason is that the `HermesInspector.dll` CMake build code requires dependencies on ReactNative, Folly, and Boost code. These dependencies are installed by the corresponding PowerShell scripts. In this PR we fix it in a way that all the required dependencies are installed by CMake. It makes the related PowerShell scripts obsolete and allows CMake code compilation directly in VS Code. (The suggestion is to install the "C/C++ Extension Pack" from Microsoft to enable the dev environment in VS Code.) The change relies on the CMake standard module `FetchContent` and has the following parts: - `API\inspector\react-native\CMakeLists.txt` brings a shallow copy of `react-native` from GitHub with version v0.66.4. - `API\inspector\folly\CMakeLists.txt` brings Folly's v2020.01.13.00.tar.gz file. We can bring a newer version by specifying different file and the related hash code. I am not sure where the hash is coming from - it does not match the file has published along with the package - I used the one shown in the error message. - `API\inspector\boost\CMakeLists.txt` brings a set of Boost libraries which are required to compile the `boost_asio` library. The PowerShell scripts that used to bring these libraries before are removed. The `cibuild.ps1` script is updated to reflect the changes and fix a few small issues: - Call `Pop-Location` in `finally` section to ensure to be called even if there was an exception. - Removed duplicated `throw` statement in line 64. - Update the argument lists. - Call `Copy-Headers` after the build because the build needs to bring the React Native headers first. - Fixed Node-API header copying. - Removed `Copy-Sources` because it is not used. - Call `Invoke-PrepareNugetPackage` in the loop along with the `Invoke-BuildAndCopy` to ensure passing correct parameters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I've enabled Hermes on our application and upon testing multiple Android versions I noticed the app is crashing at boot time on Android 4.4. Android versions 5 and up are ok.
I've been able to reproduce this on a brand new React Native project:
I've tried the same with Hermes disabled (using JSC) and this is running fine.
Crash:
D/SoLoader( 3108): About to load: libhermes.so D/SoLoader( 3108): libhermes.so not found on /data/data/com.hermes/lib-main D/SoLoader( 3108): libhermes.so found on /data/app-lib/com.hermes-1 D/SoLoader( 3108): Not resolving dependencies for libhermes.so D/dalvikvm( 3108): Trying to load lib /data/app-lib/com.hermes-1/libhermes.so 0x9d0430e0 E/dalvikvm( 3108): dlopen("/data/app-lib/com.hermes-1/libhermes.so") failed: dlopen failed: cannot locate symbol "posix_fallocate" referenced by "libhermes.so"... E/SoLoader( 3108): couldn't find DSO to load: libhermes.so caused by: dlopen failed: cannot locate symbol "posix_fallocate" referenced by "libhermes.so"... W/dalvikvm( 3108): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/facebook/hermes/reactexecutor/HermesExecutor; W/dalvikvm( 3108): threadid=11: thread exiting with uncaught exception (group=0x9cd48b20) I/dalvikvm( 3108): Could not find method android.view.View.addKeyboardNavigationClusters, referenced from method androidx.core.view.ViewCompat.addKeyboardNavigationClusters W/dalvikvm( 3108): VFY: unable to resolve virtual method 2100: Landroid/view/View;.addKeyboardNavigationClusters (Ljava/util/Collection;I)V D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 I/dalvikvm( 3108): Failed resolving Landroidx/core/view/ViewCompat$OnUnhandledKeyEventListenerWrapper; interface 488 'Landroid/view/View$OnUnhandledKeyEventListener;' W/dalvikvm( 3108): Link of class 'Landroidx/core/view/ViewCompat$OnUnhandledKeyEventListenerWrapper;' failed E/dalvikvm( 3108): Could not find class 'androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper', referenced from method androidx.core.view.ViewCompat.addOnUnhandledKeyEventListener W/dalvikvm( 3108): VFY: unable to resolve new-instance 1429 (Landroidx/core/view/ViewCompat$OnUnhandledKeyEventListenerWrapper;) in Landroidx/core/view/ViewCompat; D/dalvikvm( 3108): VFY: replacing opcode 0x22 at 0x001a I/dalvikvm( 3108): Could not find method android.view.View.cancelDragAndDrop, referenced from method androidx.core.view.ViewCompat.cancelDragAndDrop W/dalvikvm( 3108): VFY: unable to resolve virtual method 2108: Landroid/view/View;.cancelDragAndDrop ()V D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 E/dalvikvm( 3108): Could not find class 'android.view.WindowInsets', referenced from method androidx.core.view.ViewCompat.dispatchApplyWindowInsets W/dalvikvm( 3108): VFY: unable to resolve check-cast 507 (Landroid/view/WindowInsets;) in Landroidx/core/view/ViewCompat; D/dalvikvm( 3108): VFY: replacing opcode 0x1f at 0x000a I/dalvikvm( 3108): Could not find method android.view.View.dispatchNestedFling, referenced from method androidx.core.view.ViewCompat.dispatchNestedFling W/dalvikvm( 3108): VFY: unable to resolve virtual method 2116: Landroid/view/View;.dispatchNestedFling (FFZ)Z D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 I/dalvikvm( 3108): Could not find method android.view.View.dispatchNestedPreFling, referenced from method androidx.core.view.ViewCompat.dispatchNestedPreFling W/dalvikvm( 3108): VFY: unable to resolve virtual method 2117: Landroid/view/View;.dispatchNestedPreFling (FF)Z D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 I/dalvikvm( 3108): Could not find method android.view.View.dispatchNestedPreScroll, referenced from method androidx.core.view.ViewCompat.dispatchNestedPreScroll W/dalvikvm( 3108): VFY: unable to resolve virtual method 2118: Landroid/view/View;.dispatchNestedPreScroll (II[I[I)Z D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 I/dalvikvm( 3108): Could not find method android.view.View.dispatchNestedScroll, referenced from method androidx.core.view.ViewCompat.dispatchNestedScroll W/dalvikvm( 3108): VFY: unable to resolve virtual method 2119: Landroid/view/View;.dispatchNestedScroll (IIII[I)Z D/dalvikvm( 3108): VFY: replacing opcode 0x74 at 0x0006 I/dalvikvm( 3108): Could not find method android.view.View.getBackgroundTintList, referenced from method androidx.core.view.ViewCompat.getBackgroundTintList W/dalvikvm( 3108): VFY: unable to resolve virtual method 2134: Landroid/view/View;.getBackgroundTintList ()Landroid/content/res/ColorStateList; D/dalvikvm( 3108): VFY: replacing opcode 0x6e at 0x0006 E/AndroidRuntime( 3108): FATAL EXCEPTION: create_react_context E/AndroidRuntime( 3108): Process: com.hermes, PID: 3108 E/AndroidRuntime( 3108): java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so caused by: dlopen failed: cannot locate symbol "posix_fallocate" referenced by "libhermes.so"... E/AndroidRuntime( 3108): at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738) E/AndroidRuntime( 3108): at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591) E/AndroidRuntime( 3108): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529) E/AndroidRuntime( 3108): at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484) E/AndroidRuntime( 3108): at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20) E/AndroidRuntime( 3108): at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27) E/AndroidRuntime( 3108): at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:949) E/AndroidRuntime( 3108): at java.lang.Thread.run(Thread.java:841) W/ActivityManager( 1600): Force finishing activity com.hermes/.MainActivity D/gralloc_ranchu( 1173): gralloc_alloc: Creating ashmem region of size 1323008
The text was updated successfully, but these errors were encountered: