Skip to content
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

[ANDROID] A TON of crashes on Android Fabric when using entering/exiting animations #6908

Open
DominikHinc opened this issue Jan 17, 2025 · 3 comments · May be fixed by #6920
Open

[ANDROID] A TON of crashes on Android Fabric when using entering/exiting animations #6908

DominikHinc opened this issue Jan 17, 2025 · 3 comments · May be fixed by #6920
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@DominikHinc
Copy link

DominikHinc commented Jan 17, 2025

Description

Hi, a quick overview:

After enabling Fabirc on our Android app, we have started receiving a ton of crashes from our Prod monitoring. Around 5% of users experienced a crash and 99% of them were reanimated related.

The errors are not very readable as most of them happen in some C++ code.
Here is few examples:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 17456 >>> com.appName <<<

backtrace:
 #00  pc 0x000000000007af0c  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/split_config.arm64_v8a.apk!libreanimated.so (reanimated::LayoutAnimationsManager::startLayoutAnimation(facebook::jsi::Runtime&, int, LayoutAnimationType, facebook::jsi::Object const&)+540) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
 #01  pc 0x000000000008cd1c  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/split_config.arm64_v8a.apk!libreanimated.so (std::__ndk1::__function::__func<reanimated::LayoutAnimationsProxy::startEnteringAnimation(int, facebook::react::ShadowViewMutation&) const::$_0, std::__ndk1::allocator<reanimated::LayoutAnimationsProxy::startEnteringAnimation(int, facebook::react::ShadowViewMutation&) const::$_0>, void ()>::operator()()+33505280) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
 #02  pc 0x0000000000049450  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/split_config.arm64_v8a.apk!libworklets.so (worklets::UIScheduler::triggerUI()+184) (BuildId: 370909bf851643dfb3c4ee5963abb3b668299526)
 #03  pc 0x00000000000ad2c4  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidUIScheduler::*)(), &reanimated::AndroidUIScheduler::triggerUI(), reanimated::AndroidUIScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+68) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
 #04  pc 0x00000000000ad208  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+60) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
 #05  pc 0x00000000003383c0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+112)
 #06  pc 0x0000000000ceecb0  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/oat/arm64/base.odex (com.swmansion.reanimated.AndroidUIScheduler$1.runGuarded+96)
 #07  pc 0x00000000009a29cc  /data/app/~~Q1Gt9kBdTuehY_r0MSwe1Q==/com.appName-DJOPTF_BNa9BKtjqTm5Lmg==/oat/arm64/base.odex (com.facebook.react.bridge.GuardedRunnable.run+44)
 #08  pc 0x0000000000977984  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+68)
 #09  pc 0x000000000097b344  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+980)
 #10  pc 0x000000000097aed4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+916)
 #11  pc 0x000000000070ecd0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2128)
 #12  pc 0x000000000036de40  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
 #13  pc 0x00000000003698f4  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732)
 #14  pc 0x00000000006c6738  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
 #15  pc 0x000000000033e234  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)
 #16  pc 0x0000000000cabae4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+116)
 #17  pc 0x0000000000cb6564  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3396)
 #18  pc 0x000000000036de40  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
 #19  pc 0x000000000035936c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204)
 #20  pc 0x0000000000357320  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512)
 #21  pc 0x000000000073b6ac  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104)
 #22  pc 0x00000000000e4be8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+108)
 #23  pc 0x00000000000f15bc  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+856)
 #24  pc 0x0000000000002558  /system/bin/app_process64 (main+1280)
 #25  pc 0x0000000000053e50  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108)
Exception com.facebook.react.bridge.RetryableMountingLayerException:
  at com.facebook.react.fabric.mounting.SurfaceMountingManager.getViewState (SurfaceMountingManager.java:1111)
  at com.facebook.react.fabric.mounting.SurfaceMountingManager.updateProps (SurfaceMountingManager.java:693)
  at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute (IntBufferBatchMountItem.java:123)
  at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue (MountItemDispatcher.java:387)
  at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems (MountItemDispatcher.java:293)
  at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems (MountItemDispatcher.java:126)
  at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded (FabricUIManager.java:1388)
  at com.facebook.react.fabric.GuardedFrameCallback.doFrame (GuardedFrameCallback.kt)
  at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1 (ReactChoreographer.kt:60)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1429)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1439)
  at android.view.Choreographer.doCallbacks (Choreographer.java:1048)
  at android.view.Choreographer.doFrame (Choreographer.java:936)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1407)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:211)
  at android.os.Looper.loop (Looper.java:300)
  at android.app.ActivityThread.main (ActivityThread.java:8348)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:582)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1028)
Exception com.facebook.jni.CppException:
  at com.swmansion.reanimated.nativeProxy.AnimationFrameCallback.onAnimationFrame (AnimationFrameCallback.java)
  at com.swmansion.reanimated.NodesManager.onAnimationFrame (NodesManager.java:294)
  at com.swmansion.reanimated.NodesManager$2.doFrameGuarded (NodesManager.java:173)
  at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.kt)
  at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1 (ReactChoreographer.kt:60)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1229)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1239)
  at android.view.Choreographer.doCallbacks (Choreographer.java:899)
  at android.view.Choreographer.doFrame (Choreographer.java:827)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1214)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7918)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 19953 >>> com.appName <<<

backtrace:
  #00  pc 0x000000000007b094  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/split_config.arm64_v8a.apk!libreanimated.so (reanimated::LayoutAnimationsManager::startLayoutAnimation(facebook::jsi::Runtime&, int, LayoutAnimationType, facebook::jsi::Object const&)+540) (BuildId: 6ac62a8133ea31d8342b0ffb8da4b70d3563c272)
  #01  pc 0x000000000008cea4  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/split_config.arm64_v8a.apk!libreanimated.so (std::__ndk1::__function::__func<reanimated::LayoutAnimationsProxy::startEnteringAnimation(int, facebook::react::ShadowViewMutation&) const::$_0, std::__ndk1::allocator<reanimated::LayoutAnimationsProxy::startEnteringAnimation(int, facebook::react::ShadowViewMutation&) const::$_0>, void ()>::operator()()+33505280) (BuildId: 6ac62a8133ea31d8342b0ffb8da4b70d3563c272)
  #02  pc 0x0000000000049580  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/split_config.arm64_v8a.apk!libworklets.so (worklets::UIScheduler::triggerUI()+184) (BuildId: fe1e0636971671b40c34ffd24dc319420dedcc32)
  #03  pc 0x00000000000ad4c0  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidUIScheduler::*)(), &reanimated::AndroidUIScheduler::triggerUI(), reanimated::AndroidUIScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+68) (BuildId: 6ac62a8133ea31d8342b0ffb8da4b70d3563c272)
  #04  pc 0x00000000000ad404  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+60) (BuildId: 6ac62a8133ea31d8342b0ffb8da4b70d3563c272)
  #05  pc 0x00000000003323e0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+112)
  #06  pc 0x0000000000780120  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #07  pc 0x00000000002b4338  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/base.apk (com.swmansion.reanimated.AndroidUIScheduler.lambda$new$0+16)
  #08  pc 0x00000000007800c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #09  pc 0x00000000002b42a8  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/base.apk (com.swmansion.reanimated.AndroidUIScheduler.a)
  #10  pc 0x000000000077f1a4  /apex/com.android.art/lib64/libart.so (nterp_helper+52)
  #11  pc 0x00000000002b4238  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/base.apk (com.swmansion.reanimated.a.run+4)
  #12  pc 0x0000000000780ee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #13  pc 0x00000000002b4278  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/base.apk (com.swmansion.reanimated.AndroidUIScheduler$1.runGuarded+12)
  #14  pc 0x00000000007800c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #15  pc 0x00000000002a2b04  /data/app/~~8vzkQdqRjk_kjOjmow6ueA==/com.appName-j2nTiJBMof7wiqVigBr6hw==/base.apk (com.facebook.react.bridge.GuardedRunnable.run)
  #16  pc 0x00000000009d7c7c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+76)
  #17  pc 0x00000000009dbadc  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+1036)
  #18  pc 0x00000000009db628  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+1112)
  #19  pc 0x0000000000747b80  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2432)
  #20  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #21  pc 0x0000000000369190  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732)
  #22  pc 0x00000000006c9134  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #23  pc 0x00000000003389b4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)
  #24  pc 0x0000000000d40d84  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+132)
  #25  pc 0x0000000000d4bf44  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3540)
  #26  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #27  pc 0x0000000000358c08  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204)
  #28  pc 0x0000000000356bbc  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512)
  #29  pc 0x000000000073cefc  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104)
  #30  pc 0x00000000000e3be8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+108)
  #31  pc 0x00000000000f05cc  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+856)
  #32  pc 0x0000000000002558  /system/bin/app_process64 (main+1280)
  #33  pc 0x000000000008d7c8  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108)
terminating due to uncaught exception of type facebook::jni::JniException: com.facebook.react.bridge.RetryableMountingLayerException: Unable to find viewState for tag 45992. Surface stopped: false
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 22220 >>> com.appName <<<

backtrace:
  #00  pc 0x00000000000940a4  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164)
  #01  pc 0x000000000009dd84  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libc++_shared.so (abort_message+13713408) (BuildId: a3e3ad0a8d58b8363ddd6d1bd76a5ad54f2c29ad)
  #02  pc 0x000000000009ca44  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libc++_shared.so (demangling_terminate_handler()+13713408) (BuildId: a3e3ad0a8d58b8363ddd6d1bd76a5ad54f2c29ad)
  #03  pc 0x000000000009ced4  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libc++_shared.so (std::__terminate(void (*)())+13713408) (BuildId: a3e3ad0a8d58b8363ddd6d1bd76a5ad54f2c29ad)
  #04  pc 0x000000000009ce74  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libc++_shared.so (std::terminate()+56) (BuildId: a3e3ad0a8d58b8363ddd6d1bd76a5ad54f2c29ad)
  #05  pc 0x0000000000073440  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreanimated.so (__clang_call_terminate+33505280) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #06  pc 0x0000000000077a04  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreanimated.so (reanimated::ReanimatedMountHook::shadowTreeDidMount(std::__ndk1::shared_ptr<facebook::react::RootShadowNode const> const&, double)+376) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #07  pc 0x00000000004f99a4  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreactnative.so (facebook::react::UIManager::reportMount(int) const+192) (BuildId: 28106f5b708a04ff)
  #08  pc 0x0000000000358984  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreactnative.so (facebook::react::Binding::reportMount(int)+384) (BuildId: 28106f5b708a04ff)
  #09  pc 0x000000000036291c  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreactnative.so (facebook::jni::detail::MethodWrapper<void (facebook::react::Binding::*)(int), &facebook::react::Binding::reportMount(int), facebook::react::Binding, void, int>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::Binding, facebook::react::JBinding>::JavaPart, facebook::react::JBinding, void>::_javaobject*>, int&&)+64) (BuildId: 28106f5b708a04ff)
  #10  pc 0x0000000000361efc  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/split_config.arm64_v8a.apk!libreactnative.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::Binding, facebook::react::JBinding>::JavaPart, facebook::react::JBinding, void>::_javaobject*>, int&&), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::Binding, facebook::react::JBinding>::JavaPart, facebook::react::JBinding, void>::_javaobject*, void, int>::call(_JNIEnv*, _jobject*, int, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::Binding, facebook::react::JBinding>::JavaPart, facebook::react::JBinding, void>::_javaobject*>, int&&))+72) (BuildId: 28106f5b708a04ff)
  #11  pc 0x00000000003773c0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+112)
  #12  pc 0x00000000005f9adc  /data/app/~~U7ohYjv4PhUA1aRr4VUpsg==/com.appName-KU1O7NmrR4Ko-tWPJVdegQ==/oat/arm64/base.odex (com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener$1.run+268)
  #13  pc 0x0000000000a51ce4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+68)
  #14  pc 0x0000000000a55b0c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+1452)
  #15  pc 0x0000000000a554a8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+936)
  #16  pc 0x00000000007d5c7c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2108)
  #17  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #18  pc 0x0000000000369190  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732)
  #19  pc 0x00000000006c9134  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #20  pc 0x000000000037d244  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)
  #21  pc 0x0000000000c612c4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+116)
  #22  pc 0x0000000000c6cd90  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3504)
  #23  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #24  pc 0x0000000000358c08  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204)
  #25  pc 0x0000000000356bbc  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512)
  #26  pc 0x000000000073cefc  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104)
  #27  pc 0x00000000000ddca8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+104)
  #28  pc 0x00000000000e9e7c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+940)
  #29  pc 0x000000000000254c  /system/bin/app_process64 (main+1260)
  #30  pc 0x000000000008c5b8  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+104)
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 20652 >>> com.appName <<<

backtrace:
  #00  pc 0x000000000007af0c  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/split_config.arm64_v8a.apk!libreanimated.so (reanimated::LayoutAnimationsManager::startLayoutAnimation(facebook::jsi::Runtime&, int, LayoutAnimationType, facebook::jsi::Object const&)+540) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #01  pc 0x000000000008db64  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/split_config.arm64_v8a.apk!libreanimated.so (std::__ndk1::__function::__func<reanimated::LayoutAnimationsProxy::startLayoutAnimation(int, facebook::react::ShadowViewMutation const&) const::$_0, std::__ndk1::allocator<reanimated::LayoutAnimationsProxy::startLayoutAnimation(int, facebook::react::ShadowViewMutation const&) const::$_0>, void ()>::operator()()+33505280) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #02  pc 0x0000000000049450  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/split_config.arm64_v8a.apk!libworklets.so (worklets::UIScheduler::triggerUI()+184) (BuildId: 370909bf851643dfb3c4ee5963abb3b668299526)
  #03  pc 0x00000000000ad2c4  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::MethodWrapper<void (reanimated::AndroidUIScheduler::*)(), &reanimated::AndroidUIScheduler::triggerUI(), reanimated::AndroidUIScheduler, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>)+68) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #04  pc 0x00000000000ad208  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/split_config.arm64_v8a.apk!libreanimated.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::AndroidUIScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*>))+60) (BuildId: 8c1308b445979c81c2830591ba0d5edc114e23b9)
  #05  pc 0x00000000002f63c0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+112)
  #06  pc 0x0000000000941030  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/oat/arm64/base.odex (com.swmansion.reanimated.AndroidUIScheduler$1.runGuarded+96)
  #07  pc 0x00000000005f489c  /data/app/~~FCePA3q6Z4MKlW57mTzrGg==/com.appName-K2-5YZeO6JAkZwRgc5YSow==/oat/arm64/base.odex (com.facebook.react.bridge.GuardedRunnable.run+44)
  #08  pc 0x00000000008dc344  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+68)
  #09  pc 0x00000000008df300  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+944)
  #10  pc 0x00000000008deed0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+528)
  #11  pc 0x00000000006cc3f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+1560)
  #12  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #13  pc 0x0000000000369190  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732)
  #14  pc 0x00000000006c9134  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #15  pc 0x00000000002fc244  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)
  #16  pc 0x0000000000b83698  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+120)
  #17  pc 0x0000000000b8ceec  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3196)
  #18  pc 0x000000000036d840  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #19  pc 0x0000000000358c08  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204)
  #20  pc 0x0000000000356bbc  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512)
  #21  pc 0x000000000073cefc  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104)
  #22  pc 0x00000000000bcce8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120)
  #23  pc 0x00000000000c8bf8  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+840)
  #24  pc 0x0000000000002560  /system/bin/app_process64 (main+1280)
  #25  pc 0x000000000004b600  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96)
Exception com.facebook.jni.CppException:
  at com.swmansion.reanimated.AndroidUIScheduler.triggerUI (AndroidUIScheduler.java)
  at com.swmansion.reanimated.AndroidUIScheduler.lambda$new$0 (AndroidUIScheduler.java:22)
  at com.swmansion.reanimated.AndroidUIScheduler$1.runGuarded (AndroidUIScheduler.java:40)
  at com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:240)
  at android.os.Looper.loop (Looper.java:351)
  at android.app.ActivityThread.main (ActivityThread.java:8377)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:584)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)

And thousands more similar ones.

Steps to reproduce

We figured out that it has to be related to entering/exiting animations as most crashes would appear when user would interact with component like this:

import Reanimated, {FadeIn, FadeOut} from 'react-native-reanimated'
import Image from 'react-native-fast-image'
import FlashList from '@shopify/flash-list'

const Component1 = () =>{

  const select = useSelect()

  return <Reanimated.View entering={FadeIn} exiting={Fadeout}>
    <TouchableWithoutFeedback onPressIn={select}>
        <Image />
    </TouchableWithoutFeedback>
  </Reanimated.View>
}


const Component2 = () =>{

  return <View>
    <SomeOtherComponentShownAfterHidingComponent1 />
  </View>
}


const MainComponent = () =>{
  const isSelected = useIsSelected()

  if(!hide){
    return <Component1 />
  }

  return <Component2 />
}


const ListOfMainComponents = () =>{
  const data = [...someData]

  const renderItem = useCallback((item, index)=>{
    return <MainComponent key={index} />
  }, [])

  return <SomeSelectionProvider>
    <FlashList data={data} renderItem={renderItem} />
  </SomeSelectionProvider>
}

export default ListOfMainComponents

Keep in mind this is just one of the structures that would cause problems.

The worst part is that there is no consistent repro, user would interact with X of those components just fine, when suddenly one of them would cause a crash.

No idea what is the cause, but one thing is certain, it's due to the entering/exiting.

How do I know that? Well after applying this patch:

diff --git a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
index b713f42..99b7099 100644
--- a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
+++ b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
@@ -57,6 +57,7 @@ import { ReanimatedError } from '../errors';
 const IS_WEB = isWeb();
 const IS_JEST = isJest();
 const SHOULD_BE_USE_WEB = shouldBeUseWeb();
+const IS_ANDROID = Platform.OS === 'android';
 
 if (IS_WEB) {
   configureWebLayoutAnimations();
@@ -145,7 +146,8 @@ export function createAnimatedComponent(
       if (IS_JEST) {
         this.jestAnimatedStyle = { value: {} };
       }
-      const entering = this.props.entering;
+
+      const entering = IS_ANDROID ? null : this.props.entering;
       if (entering && isFabric()) {
         updateLayoutAnimations(
           this.reanimatedID,
@@ -213,7 +215,7 @@ export function createAnimatedComponent(
         true
       );
 
-      const exiting = this.props.exiting;
+      const exiting = IS_ANDROID ? null : this.props.exiting;
 
       if (
         IS_WEB &&
@@ -500,7 +502,11 @@ export function createAnimatedComponent(
           this._componentViewTag = tag;
         }
 
-        const { layout, entering, exiting, sharedTransitionTag } = this.props;
+        const { layout, entering: enteringProps, exiting: exitingProps, sharedTransitionTag } = this.props;
+
+        const entering = IS_ANDROID ? null : enteringProps;
+        const exiting = IS_ANDROID ? null : exitingProps;
+
         if (
           (layout || entering || exiting || sharedTransitionTag) &&
           tag != null
@@ -568,6 +574,11 @@ export function createAnimatedComponent(
     render() {
       const filteredProps = this._PropsFilter.filterNonAnimatedProps(this);
 
+      if(IS_ANDROID){
+        filteredProps.entering = null;
+        filteredProps.exiting = null;
+      }
+
       if (IS_JEST) {
         filteredProps.jestAnimatedStyle = this.jestAnimatedStyle;
       }

The crashes are gone, almost no more logs appearing in Prod monitoring.
Only few remain, and I have a suspicion it might be related to LinearTransition, which we are also using. But the total number of crashes got reduced by 99% with the patch mentioned above, so that's what I would like to focus on in this Issue.

Snack or a link to a repository

No constant repro, just observed through prod logs

Reanimated version

3.16.4

React Native version

0.76.6

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

All

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Jan 17, 2025
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@mluiten
Copy link

mluiten commented Jan 20, 2025

Probably won't help, but I'm seeing this as well. Even in the "Pre-launch report" feature of Play Store it seems to crash sometimes. I cannot replicate with my own devices.

Stacktraces look the same as yours, with startLayoutAnimation.

I'm using Expo 52 btw

@pilje
Copy link

pilje commented Jan 21, 2025

We're using Expo (v. 52.0.9) and are also experiencing the same issues on Android. We've only observed the crashes on login/logout so far, but if it has something to do with entering/exiting animations that could explain that. The crashes only happen on production builds, nothing when running the app in development.

We also have startLayoutAnimation at the top of the stacktrace:

pid: 0, tid: 24632 >>> appName <<<

#00  pc 0x000000000007b094  /data/app/~~67gyrjeklaJJ==/appName-67gyrjeklaJJ==/base.apk!libreanimated.so (reanimated::LayoutAnimationsManager::startLayoutAnimation(facebook::jsi::Runtime&, int, LayoutAnimationType, facebook::jsi::Object const&)+540)

Versions

"expo": "^52.0.9",
"react-native": "0.76.2",
"react-native-reanimated": "^3.16.7"

Workaround

Disabling Fabric by setting newArchEnabled=false in gradle.properties solved it in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants