react-native-reanimated: [2.2.2] [Android] The application crashes on launch with react-native 0.65.1

Description

After updating to react-native 0.65.1 the application crashes on launch. I previously tried with reanimated 2.2.1 and it crashes with the same error. I have Hermes enabled and the app crashes in both release and debug mode.

Expected behavior

The app launches.

Actual behavior & steps to reproduce

The app crashes on launch with the following error (crash.log):

09-15 11:38:00.229  2275  2584 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 in tid 2584 (mqt_js), pid 2275 (nts.development)
09-15 11:38:00.319  2591  2591 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
09-15 11:38:00.324   939   939 I tombstoned: received crash request for pid 2584
09-15 11:38:00.326  2591  2591 I crash_dump64: performing dump of process 2275 (target tid = 2584)
09-15 11:38:00.335  2591  2591 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-15 11:38:00.336  2591  2591 F DEBUG   : Build fingerprint: 'google/sargo/sargo:11/RQ3A.210805.001.A1/7474174:user/release-keys'
09-15 11:38:00.336  2591  2591 F DEBUG   : Revision: 'MP1.0'
09-15 11:38:00.336  2591  2591 F DEBUG   : ABI: 'arm64'
09-15 11:38:00.336  2591  2591 F DEBUG   : Timestamp: 2021-09-15 11:38:00-0300
09-15 11:38:00.336  2591  2591 F DEBUG   : pid: 2275, tid: 2584, name: mqt_js  >>> com.candidly.photo.moments.development <<<
09-15 11:38:00.336  2591  2591 F DEBUG   : uid: 10633
09-15 11:38:00.336  2591  2591 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1
09-15 11:38:00.336  2591  2591 F DEBUG   : Cause: null pointer dereference
09-15 11:38:00.336  2591  2591 F DEBUG   :     x0  0000000000000028  x1  0000000000000000  x2  0000000000000000  x3  0000000000000000
09-15 11:38:00.336  2591  2591 F DEBUG   :     x4  0000000000000010  x5  0000007853644218  x6  0000000000000022  x7  000000000000007d
09-15 11:38:00.336  2591  2591 F DEBUG   :     x8  00000000000003c0  x9  7efdb00a52ffebae  x10 0000000000000002  x11 0000000000000001
09-15 11:38:00.336  2591  2591 F DEBUG   :     x12 0000007af40ec22b  x13 0000000000000000  x14 0000007af4183d22  x15 00000077f0000000
09-15 11:38:00.336  2591  2591 F DEBUG   :     x16 0000007af4180cd0  x17 0000007af4103ad4  x18 0000007852752000  x19 0000007a0357ef60
09-15 11:38:00.336  2591  2591 F DEBUG   :     x20 0000000000000001  x21 0000007853647000  x22 00000078536441d8  x23 0000007a0357f170
09-15 11:38:00.336  2591  2591 F DEBUG   :     x24 0000007a0357ef18  x25 0000007a0357f048  x26 0000007853647000  x27 0000000000015000
09-15 11:38:00.336  2591  2591 F DEBUG   :     x28 0000000002000000  x29 0000007853644610
09-15 11:38:00.336  2591  2591 F DEBUG   :     lr  00000078537d5190  sp  00000078536441c0  pc  00000078537d5190  pst 0000000060000000
09-15 11:38:00.559  2591  2591 F DEBUG   : backtrace:
09-15 11:38:00.559  2591  2591 F DEBUG   :     NOTE: Function names and BuildId information is missing for some frames due
09-15 11:38:00.559  2591  2591 F DEBUG   :     NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
09-15 11:38:00.559  2591  2591 F DEBUG   :     NOTE: found under the lib/ directory are readable.
09-15 11:38:00.559  2591  2591 F DEBUG   :       #00 pc 0000000000110190  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #01 pc 0000000000101370  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #02 pc 00000000001011a8  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #03 pc 000000000009353c  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #04 pc 0000000000092f30  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #05 pc 0000000000037e08  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #06 pc 0000000000030700  /data/data/com.candidly.photo.moments.development/lib-main/libhermes.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #07 pc 000000000001ab8c  /data/data/com.candidly.photo.moments.development/lib-main/libhermes-executor-common-release.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #08 pc 000000000008f954  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #09 pc 00000000000872d8  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #10 pc 0000000000087088  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #11 pc 0000000000064e88  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #12 pc 0000000000063a88  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #13 pc 0000000000059248  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #14 pc 00000000000591c0  /data/data/com.candidly.photo.moments.development/lib-main/libreactnativejni.so
09-15 11:38:00.559  2591  2591 F DEBUG   :       #15 pc 000000000013ced4  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #16 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #17 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #18 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #19 pc 000000000030e648  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #20 pc 000000000067df14  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1032) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #21 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #22 pc 000000000036e0d0  /system/framework/framework.jar (offset 0x91a000) (android.os.Handler.handleCallback+4)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #23 pc 000000000067f740  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.559  2591  2591 F DEBUG   :       #24 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #25 pc 000000000036df3c  /system/framework/framework.jar (offset 0x91a000) (android.os.Handler.dispatchMessage+8)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #26 pc 000000000067d59c  /apex/com.android.art/lib64/libart.so (MterpInvokeSuper+2468) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #27 pc 000000000012d894  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_super+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #28 pc 0000000000339168  [anon:dalvik-classes.dex extracted in memory from /data/app/~~tjL85cv2j6Ps6IIN163LHw==/com.candidly.photo.moments.development-DfcouTMLhLWCCmxv6WPAcA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #29 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+268) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #30 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #31 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #32 pc 000000000201a388  /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Looper.loop+1448)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #33 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #34 pc 00000000001a8a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #35 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #36 pc 0000000000305d04  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+460) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #37 pc 000000000030dc34  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+200) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #38 pc 000000000030e62c  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #39 pc 000000000067f49c  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+548) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #40 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #41 pc 00000000003392f6  [anon:dalvik-classes.dex extracted in memory from /data/app/~~tjL85cv2j6Ps6IIN163LHw==/com.candidly.photo.moments.development-DfcouTMLhLWCCmxv6WPAcA==/base.apk] (com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #42 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #43 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #44 pc 00000000000eb7d0  /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #45 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+268) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #46 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #47 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #48 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #49 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #50 pc 0000000000554cbc  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #51 pc 00000000005a4058  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 0183cc6150704cdc371a87b659800e56)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #52 pc 00000000000afd4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 49090ae59e6ae37f8beae53c551820ad)
09-15 11:38:00.560  2591  2591 F DEBUG   :       #53 pc 0000000000050288  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 49090ae59e6ae37f8beae53c551820ad)

Package versions

  • React Native: 0.65.1
  • React Native Reanimated: 2.2.2
  • NodeJS: 16.9.1
  • Xcode: 12.5.1
  • Java: OpenJDK 11
  • Gradle: 6.9.1
  • Gradle Android Plugin: 4.2.2

Affected platforms

  • Android
  • iOS
  • Web

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 19
  • Comments: 35

Most upvoted comments

I too am experiencing this crash too

Make sure you have added "react-native-reanimated/plugin" plugin to your babel config and it is the last one in the array. Also, Don’t forget to add import 'react-native-reanimated'; at the top of your application’s entry point JS file(index.js).

Try this, works for me…! “react-native-reanimated”: “^2.3.0-beta.2”,

1. npm install react-native-reanimated@next --S
2. cd ios && pod install && cd … 3. Delete libraries on ~/Library/Developer/Xcode/DerivedData 4. run again project npx react-native run-ios

I just checked and did not see it 😕

In our case we were having this same crash on Android with error log: libc: Fatal signal 11 (SIGSEGV) … We don’t have hermes enabled.

We found out that this was due to a compatibility issues of the two dependencies: react-native-reanimated v2 + realm as stated in this thread: https://github.com/realm/realm-js/issues/3837 Realm doesn’t have yet support for hermes, they are currently working on it.

Here is another thread in react-native repo where there are conversations regarding the same crash, I have added a very similar comment to this one there as well: https://github.com/facebook/react-native/issues/33083

We have decided to remove realm from the project and we are not experiencing this crash anymore. Hope this can help anybody with the same setup as our 😃

besides needing to add the plugin to your babel file as others said, you also need to add “import ‘react-native-reanimated’” to your index.js or App.js file on first line and run expo start --clear. It only stopped crashing after I cleared it.

Make sure you have added "react-native-reanimated/plugin" plugin to your babel config and it is the last one in the array. Also, Don’t forget to add import 'react-native-reanimated'; at the top of your application’s entry point JS file(index.js).

Great! This works for me. Thanks. I am using this version: “react-native-reanimated”: “~2.1.0”

image

I am having an issue when building for iOS 15 with version 2.2.2, this time with Pods:

** BUILD FAILED **


The following build commands failed:
	CompileC /Users/relvis/Library/Developer/Xcode/DerivedData/myapp-gvcwxfuwxztfbrcqvssncjqsokzh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/x86_64/UIResponder+Reanimated.o /Users/relvis/Projects/RNProjects/myapp/node_modules/react-native-reanimated/ios/native/UIResponder+Reanimated.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNReanimated' from project 'Pods')
	CompileC /Users/relvis/Library/Developer/Xcode/DerivedData/myapp-gvcwxfuwxztfbrcqvssncjqsokzh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/x86_64/REAInitializer.o /Users/relvis/Projects/RNProjects/myapp/node_modules/react-native-reanimated/ios/native/REAInitializer.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNReanimated' from project 'Pods')
(2 failures)

Any help will be appreciated!

You have to make a new build after pod install, have you done that too?

Yes, sure. Build, clean, build, remove pods, node_modules, reinstall again, try different versions - I did that at least a dozen of times

@malikKartik

Also, Don’t forget to add import ‘react-native-reanimated’; at the top of your application’s entry point JS file(index.js).

This solved it for me. I knew this was required for RNGH, but didn’t realize it was needed for this library as well.

Thanks!