React Native app using Hermes crashes on Android 4.4
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:
- react-native init
- Enable Hermes
- Create APK and run on Android 4.4 device --> Crash
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
Just noticed there was a duplicate issue at https://github.com/facebook/hermes/issues/42 Closing.