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

Fix uncaught exception 'NSUnknownKeyException' on app reload on iOS #5976

Merged
merged 1 commit into from
May 5, 2024

Conversation

tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented May 5, 2024

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

@tomekzaw tomekzaw changed the title Fix uncaught exception 'NSUnknownKeyException' on app reload Fix uncaught exception 'NSUnknownKeyException' on app reload on iOS May 5, 2024
@tomekzaw tomekzaw added this pull request to the merge queue May 5, 2024
Merged via the queue into main with commit 1f17bbd May 5, 2024
13 checks passed
@tomekzaw tomekzaw deleted the @tomekzaw/fix-reload-ios-uncaught-exception branch May 5, 2024 16:34
GSTJ pushed a commit to GSTJ/react-native-magic-modal that referenced this pull request May 25, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-reanimated](https://togithub.com/software-mansion/react-native-reanimated)
| [`~3.10.1` ->
`~3.11.0`](https://renovatebot.com/diffs/npm/react-native-reanimated/3.10.1/3.11.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-reanimated/3.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-reanimated/3.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-reanimated/3.10.1/3.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-reanimated/3.10.1/3.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-reanimated
(react-native-reanimated)</summary>

###
[`v3.11.0`](https://togithub.com/software-mansion/react-native-reanimated/releases/tag/3.11.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-reanimated/compare/3.10.1...3.11.0)

#### What's Changed

- Fix EXC_BAD_ACCESS crash on iOS in `[REAAnimationsManager
clearSharedTransitionConfigForTag:]` by
[@&#8203;tomekzaw](https://togithub.com/tomekzaw) in
[software-mansion/react-native-reanimated#5975
- Fix uncaught exception 'NSUnknownKeyException' on app reload on iOS by
[@&#8203;tomekzaw](https://togithub.com/tomekzaw) in
[software-mansion/react-native-reanimated#5976
- Test two ways to use sharedValue in `useAnimatedStyle` by
[@&#8203;Latropos](https://togithub.com/Latropos) in
[software-mansion/react-native-reanimated#5893
- docs: fix grammar by [@&#8203;wodin](https://togithub.com/wodin) in
[software-mansion/react-native-reanimated#5978
- fix: build issues on visionOS by
[@&#8203;okwasniewski](https://togithub.com/okwasniewski) in
[software-mansion/react-native-reanimated#5980

**Full Changelog**:
software-mansion/react-native-reanimated@3.10.0...3.11.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/GSTJ/react-native-magic-modal).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants