software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.81k stars 1.28k forks source link

App is crashing when I use with react-navigation-bottom-tabs and native-stack #6222

Closed RalissonMattias closed 1 month ago

RalissonMattias commented 1 month ago

Description

When I navigate between tabs the application crashes

https://github.com/software-mansion/react-native-reanimated/assets/92331757/600417f0-9398-4582-9eb0-c416db4f81bd

Logs:

0   CoreFoundation                         0x18049111c __exceptionPreprocess + 160
1   libobjc.A.dylib                        0x18008412c objc_exception_throw + 56
2   Foundation                             0x180d11770 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0
3   reanimatedWithBottomTabsTest           0x10496cf34 -[RCTViewComponentView unmountChildComponentView:index:] + 560 (RCTViewComponentView.mm:136)
4   reanimatedWithBottomTabsTest           0x104341614 -[RNSScreenView unmountChildComponentView:index:] + 244 (RNSScreen.mm:701)
5   reanimatedWithBottomTabsTest           0x1048c4f3c RCTPerformMountInstructions(std::__1::vector<facebook::react::ShadowViewMutation, std::__1::allocator<facebook::react::ShadowViewMutation>> const&, RCTComponentViewRegistry*, RCTMountingTransactionObserverCoordinator&, int) + 1344 (RCTMountingManager.mm:101)
6   reanimatedWithBottomTabsTest           0x1048c49f0 -[RCTMountingManager performTransaction:]::$_1::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 80 (RCTMountingManager.mm:275)
7   reanimatedWithBottomTabsTest           0x1048c4994 decltype(std::declval<-[RCTMountingManager performTransaction:]::$_1&>()(std::declval<facebook::react::MountingTransaction const&>(), std::declval<facebook::react::SurfaceTelemetry const&>())) std::__1::__invoke[abi:v160006]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40 (invoke.h:394)
8   reanimatedWithBottomTabsTest           0x1048c493c void std::__1::__invoke_void_return_wrapper<void, true>::__call<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40 (invoke.h:488)
9   reanimatedWithBottomTabsTest           0x1048c4908 std::__1::__function::__alloc_func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:v160006](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44 (function.h:185)
10  reanimatedWithBottomTabsTest           0x1048c3774 std::__1::__function::__func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44 (function.h:356)
11  reanimatedWithBottomTabsTest           0x1046fa2ac std::__1::__function::__value_func<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:v160006](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 84 (function.h:510)
12  reanimatedWithBottomTabsTest           0x1046f9364 std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 40 (function.h:1156)
13  reanimatedWithBottomTabsTest           0x1046f91c0 facebook::react::TelemetryController::pullTransaction(std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&) const + 292 (TelemetryController.cpp:39)
14  reanimatedWithBottomTabsTest           0x1048bed38 -[RCTMountingManager performTransaction:] + 480 (RCTMountingManager.mm:267)
15  reanimatedWithBottomTabsTest           0x1048beb28 -[RCTMountingManager initiateTransaction:] + 372
16  reanimatedWithBottomTabsTest           0x1048be53c __42-[RCTMountingManager scheduleTransaction:]_block_invoke + 324 (RCTMountingManager.mm:209)
17  reanimatedWithBottomTabsTest           0x1045053d4 __RCTExecuteOnMainQueue_block_invoke + 40 (RCTUtils.m:280)
18  libdispatch.dylib                      0x18016b4f4 _dispatch_call_block_and_release + 24
19  libdispatch.dylib                      0x18016cd3c _dispatch_client_callout + 16
20  libdispatch.dylib                      0x18017bb24 _dispatch_main_queue_drain + 1272
21  libdispatch.dylib                      0x18017b61c _dispatch_main_queue_callback_4CF + 40
22  CoreFoundation                         0x1803f1a30 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
23  CoreFoundation                         0x1803ec148 __CFRunLoopRun + 1936
24  CoreFoundation                         0x1803eb5a4 CFRunLoopRunSpecific + 572
25  GraphicsServices                       0x18e9fbae4 GSEventRunModal + 160
26  UIKitCore                              0x1852f02e4 -[UIApplication _run] + 868
27  UIKitCore                              0x1852f3f5c UIApplicationMain + 124
28  reanimatedWithBottomTabsTest           0x1041290cc main + 96 (main.m:8)
29  dyld_sim                               0x10781d544 start_sim + 20
30  dyld                                   0x10721e0e0 start + 2360
31  ???                             0x8151000000000000 ???

Steps to reproduce

  1. Click in the tab option to navigate to the screen with Animated.View
  2. Click in another tab

Snack or a link to a repository

https://github.com/RalissonMattias/reanimatedWithBottomTabsTest

Reanimated version

3.13.0

React Native version

0.74.3

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

Iphone 15 Pro

Acknowledgements

Yes

szydlovsky commented 1 month ago

@RalissonMattias the issue doesn't seem to be connected to reanimated whatsoever - neither the use case, nor the logs.

RalissonMattias commented 1 month ago

@szydlovsky Please evaluate the problem carefully, when I return to v3.12.1 the problem does not happen.

chrisnojima commented 1 month ago

I also have the same issue. going to 3.14 to 3.13 it crashes but 3.12.1 works fine