software-mansion / react-native-reanimated

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

[Bug]: 3.10.0 - Uncaught exception 'NSUnknownKeyException', reason: '[<RCTUIManager 0x600002acc230> valueForUndefinedKey:] #5973

Closed felixaa closed 2 months ago

felixaa commented 2 months ago

Description

On the 3.10.0 release the app crashes when reloading or opening the debug menu (cmd+ctrl+z) due to an exception being thrown.

[CoreFoundation] *** Terminating app due to
uncaught exception 'NSUnknownKeyException',
reason: '[<RCTUIManager 0x6000029190a0>
valueForUndefinedKey:]: this class is not key
value coding-compliant for the key _uiManager.'
*** First throw call stack:
(
0   CoreFoundation
0x00000001804ae138 __exceptionPreprocess + 172
1   libobjc.A.dylib
0x0000000180087db4 objc_exception_throw + 56
2   CoreFoundation
0x00000001804adcdc -[NSException init] + 0
3   Foundation
0x0000000180d6acf8 -[NSObject(NSKeyValueCoding)
valueForUndefinedKey:] + 188
4   Foundation
0x0000000180d69c60 -[NSObject(NSKeyValueCoding)
valueForKey:] + 260
5   reanimatedtest
0x0000000100806b44 __70-[REASwizzledUIManager
reanimated_uiBlockWithLayoutUpdateForRootView:]_block_invoke
+ 48
6   reanimatedtest
0x000000010096663c
__RCTExecuteOnMainQueue_block_invoke + 40
7   libdispatch.dylib                  <…>
› Stopped server

Steps to reproduce

  1. Create a fresh expo app
  2. Install and setup reanimated bunx expo install react-native-reanimated@3.10.0
  3. Scaffold a simple example using an Animated.View
  4. Reload the app or open the debug menu
        <Animated.View entering={FadeInDown} style={styles.container}>
            <Text>Open up App.js to start working on your app!</Text>
            <StatusBar style="auto" />
        </Animated.View>

Snack or a link to a repository

https://github.com/felixaa/reanimated-exception-repro

Reanimated version

3.10.0

React Native version

0.73.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

iPhone 15 Pro

Acknowledgements

Yes

lcarrettin commented 2 months ago

Also happening when changing the device orientation or resizing the window in Mac Catalyst.

karam1ashqar commented 2 months ago

happening on reload the app, this is happening since 3.9.0 i think

yuriiburov commented 2 months ago

The same problem maybe downgrading react-native-reanimated to 3.9.0 would be a solution to the problem

Edit: It's working for me😁

daxaxelrod commented 2 months ago

Confirmed its happening to me too.

See that uiBlockWithLayoutUpdateForRootView hasn't been updated in a while but there have been other changes here recently. Mind taking a look @tomekzaw?

https://github.com/software-mansion/react-native-reanimated/blame/cea5dff5f0bfa3b825e0ad138bbf13848187d281/apple/LayoutReanimation/REASwizzledUIManager.mm#L57

jgiunta1 commented 2 months ago

Same, please fix

karam1ashqar commented 2 months ago

A pull request was merged, waiting for the release @jgiunta1

tomekzaw commented 2 months ago

At first glance, this looks like a different bug than the one with [REAAnimationsManager clearSharedTransitionConfigForTag:], starting the investigation right now

tomekzaw commented 2 months ago

I was able to reproduce this issue on cea5dff5f by pressing r in "[SET] Card" example:

https://github.com/software-mansion/react-native-reanimated/assets/20516055/90685b58-1385-4b59-90e5-949f7e2b485c

tomekzaw commented 2 months ago

Found the root cause and submitted a PR with the fix: