Open
Description
Describe the bug
App crashes after re-connected to car play and pressing on any list item.
To Reproduce
- Display root template where it would have list template with some list items.
- Shut down car play emulator.
- Re-open car play simulator.
- Observe same template is shown.
- Press on any list item.
- App crashes
Expected behavior
App should handle clicks as expected
Screenshots/Videos
Screen.Recording.2024-05-21.at.19.07.34.mov
CarPlay (please complete the following information):
- Device: Simulator
- OS version iOS 17
- RNCarPlay version 2.4.0
Additional context
This bug was captured on production. Same behaviour can we observed with real device.
My guess is that CarScene keeps a reference to an old template even if the app is trying to set new root template.
This is a public project if you need to check any code.
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x83f20 __exceptionPreprocess
1 libobjc.A.dylib 0x16018 objc_exception_throw
2 CoreFoundation 0x15e6c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
3 CoreFoundation 0x15a88 +[NSDictionary dictionaryWithObjects:forKeys:count:]
4 lrtApp 0x9e0bf8 -[RNCarPlay listTemplate:didSelectListItem:completionHandler:] + 1273 (RNCarPlay.m:1273)
5 CarPlay 0x1d3a0 __95-[CPListTemplate listTemplateWithIdentifier:didSelectListItemWithIdentifier:completionHandler:]_block_invoke
6 libdispatch.dylib 0x213c _dispatch_call_block_and_release
7 libdispatch.dylib 0x3dd4 _dispatch_client_callout
8 libdispatch.dylib 0x125a4 _dispatch_main_queue_drain
9 libdispatch.dylib 0x121b8 _dispatch_main_queue_callback_4CF
10 CoreFoundation 0x56710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
11 CoreFoundation 0x53914 __CFRunLoopRun
12 CoreFoundation 0x52cd8 CFRunLoopRunSpecific
13 GraphicsServices 0x11a8 GSEventRunModal
14 UIKitCore 0x40a90c (Missing UUID 1741fa374e53371e8daed611aab0043d)
15 UIKitCore 0x4be9d0 (Missing UUID 1741fa374e53371e8daed611aab0043d)
16 UIKitCore 0x638384 (Missing UUID 1741fa374e53371e8daed611aab0043d)
17 lrtApp 0x91ac main (AppDelegate.swift)
18 ??? 0x1c0151e4c (Missing)
```
Activity