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

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

Closed
felixaa opened this issue May 3, 2024 · 9 comments · Fixed by #5976
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided Reproducible 🎉

Comments

@felixaa
Copy link

felixaa commented May 3, 2024

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

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided labels May 3, 2024
@lcarrettin
Copy link

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

@karam1ashqar
Copy link

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

@yuriiburov
Copy link

yuriiburov commented May 4, 2024

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
Copy link

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
Copy link

jgiunta1 commented May 5, 2024

Same, please fix

@karam1ashqar
Copy link

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

@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

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

@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

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

Screen.Recording.2024-05-05.at.16.28.15.mp4

@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

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

github-merge-queue bot pushed a commit that referenced this issue May 5, 2024
…5976)

## Summary

Fixes
#5973.

```
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<RCTUIManager 0x600002bbd340> 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   ReanimatedExample                   0x0000000104a079c0 __70-[REASwizzledUIManager reanimated_uiBlockWithLayoutUpdateForRootView:]_block_invoke + 48
	6   ReanimatedExample                   0x0000000104bf23fc __RCTExecuteOnMainQueue_block_invoke + 40
	7   libdispatch.dylib                   0x0000000108557ec4 _dispatch_call_block_and_release + 24
	8   libdispatch.dylib                   0x000000010855973c _dispatch_client_callout + 16
	9   libdispatch.dylib                   0x00000001085693f8 _dispatch_main_queue_drain + 1228
	10  libdispatch.dylib                   0x0000000108568f1c _dispatch_main_queue_callback_4CF + 40
	11  CoreFoundation                      0x000000018040e9a0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
	12  CoreFoundation                      0x00000001804090b8 __CFRunLoopRun + 1936
	13  CoreFoundation                      0x0000000180408514 CFRunLoopRunSpecific + 572
	14  GraphicsServices                    0x000000018ef06ae4 GSEventRunModal + 160
	15  UIKitCore                           0x00000001853e8040 -[UIApplication _run] + 868
	16  UIKitCore                           0x00000001853ebcc8 UIApplicationMain + 124
	17  ReanimatedExample                   0x00000001048a26cc main + 96
	18  dyld                                0x00000001075b1544 start_sim + 20
	19  ???                                 0x000000010784a0e0 0x0 + 4421099744
	20  ???                                 0xfb7e800000000000 0x0 + 18122062688073809920
)
libc++abi: terminating due to uncaught exception of type NSException
```

This PR is a follow-up to
#5957.

Note that SETs still don't work properly after reload but this is not a
regression from this PR as it also happens on main.

## Test plan

1. Launch Reanimated Example app
2. Open "[SET] Card" example
3. Reload the app
4. Confirm there's no crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided Reproducible 🎉
Projects
None yet
7 participants