RNScreenContainer crashes on iOS while in the background
See original GitHub issueDescription
RNScreenContainer crashes, as per below, while the app is in the background. The error happens at random times (i.e. not immediately before/after backgrounding the app), presumably when our background task kicks in. I unfortunately haven’t been able to reproduce yet…
OS Version: iOS 14.4.2 (18D70)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0
Application Specific Information:
*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Thread 0 Crashed:
0 CoreFoundation 0x30881986c __exceptionPreprocess
1 libobjc.A.dylib 0x33296ac4c objc_exception_throw
2 CoreFoundation 0x308889e18 _CFThrowFormattedException
3 CoreFoundation 0x3088872fc -[__NSArrayM insertObject:atIndex:].cold.1
4 CoreFoundation 0x3086f6b8c -[__NSArrayM insertObject:atIndex:]
5 UIKitCore 0x30c9c1518 -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:]
6 GreenTriangle 0x202faf204 -[RNSScreenContainerView attachScreen:atIndex:] (RNSScreenContainer.m:144)
7 GreenTriangle 0x202faf72c -[RNSScreenContainerView updateContainer] (RNSScreenContainer.m:189)
8 GreenTriangle 0x202fafe58 __41-[RNSScreenContainerManager markUpdated:]_block_invoke (RNSScreenContainer.m:276)
Package versions
react-native-screens@3.2.0 react-native@0.64.1 react@17.0.1
It has been happening since our previous release, on: react-native-screens@2.17.1 react-native@0.63.4 react@16.13.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:21 (6 by maintainers)
Top Results From Across the Web
RNScreenContainer crashes on iOS while in the background
RNScreenContainer crashes on iOS while in the background.
Read more >Random background crashes | Apple Developer Forums
Hi,. My app is getting background crash. I have provided crash report below. Could you please suggest any solution to this crash? It...
Read more >react native crash in ios while running in background
I am using bugsnag to collect crash reports, but in that case it doesn't submit any report (maybe because the app gets killed...
Read more >iOS App Crashing in Background – Home of C25K
iOS App Crashing in Background. iOS will shut down apps in the background for a number of reasons. Please check the following settings...
Read more >How to Fix Crashing Apps on an iPhone or Android?
When crafting your error messages, make them informative and useful. Avoid technical jargon; it's essential that any user, no matter their technical background, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If it help, we are also experiencing the exact same crash.
Same as above most crashes happen after app comes to foreground from background.
We are currently using: react-navigation/bottom-tabs:@5.11.8 react-navigation/native@^5.9.3 react-navigation/stack@^5.14.3 react-native-screens@3.1.1 react-native@0.64.0 react@17.0.1
Edit: we’re seeing another issue related to this
EXC_BAD_ACCESS Exception 1, Code 458777608, Subcode 8 > Attempted to dereference garbage pointer 0xa5991b586408.
@WoLewicki Sorry, I am not getting this issue on my local machine but it is getting by some users on production