question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] Crashed: com.apple.main-thread

See original GitHub issue

I got this crash today via Crashlytics. It seems we must to handle the code in didPickDocumentsAtURLs on main thread.

Crashed: com.apple.main-thread
0  Stuneo                         0x1050e13b0 -[RNDocumentPicker documentPicker:didPickDocumentsAtURLs:] + 167 (RNDocumentPicker.m:167)
1  UIKitCore                      0x1a03f3384 __74-[UIDocumentPickerViewController _callDelegateWithSelectedURLsAndDismiss:]_block_invoke + 128
2  UIKitCore                      0x1a037124c -[UIViewController dismissViewControllerWithTransition:completion:] + 1236
3  UIKitCore                      0x1a0389128 -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 264
4  UIKitCore                      0x1a0385874 -[_UIViewControllerTransitionContext _runAlongsideCompletions] + 132
5  UIKitCore                      0x1a03855b8 -[_UIViewControllerTransitionContext completeTransition:] + 116
6  UIKitCore                      0x1a0dcbfe0 -[UITransitionView notifyDidCompleteTransition:] + 240
7  UIKitCore                      0x1a0dcbc8c -[UITransitionView _didCompleteTransition:] + 1132
8  UIKitCore                      0x1a0e01d90 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 588
9  UIKitCore                      0x1a0dd5c70 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 244
10 UIKitCore                      0x1a0dd6178 -[UIViewAnimationState animationDidStop:finished:] + 240
11 UIKitCore                      0x1a0dd62c8 -[UIViewAnimationState animationDidStop:finished:] + 576
12 QuartzCore                     0x1a3387dac CA::Layer::run_animation_callbacks(void*) + 276
13 libdispatch.dylib              0x19c5bf184 _dispatch_client_callout + 16
14 libdispatch.dylib              0x19c571190 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
15 CoreFoundation                 0x19c8705e4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
16 CoreFoundation                 0x19c86b5d8 __CFRunLoopRun + 2004
17 CoreFoundation                 0x19c86aadc CFRunLoopRunSpecific + 464
18 GraphicsServices               0x1a680b328 GSEventRunModal + 104
19 UIKitCore                      0x1a097863c UIApplicationMain + 1936
20 Stuneo                         0x104a48864 main + 14 (main.m:14)
21 libdyld.dylib                  0x19c6f4360 start + 4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:24 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
hungpscommented, Jun 15, 2020

@r0b0t3d yes, exactly!

2reactions
r0b0t3dcommented, Sep 9, 2020

@PointCodeZero Fixed from @phatmann is on his repo. As @vonovak said above, he will fix this issue. While waiting the fix, you could easily apply above workaround by using patch-package and edit the code in RNDocumentPicker.m and add this check

        if (resolve == nil) {
            return;
        }
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find root cause Crashed: com.apple.main-thread in ...
This will keep deallocated objects alive (zombies) and when one of them is messaged, the caller and message will be captured on the...
Read more >
How to fix Crashed: com.apple.main-thread and catch errors?
I have the following crash in my Firebase Crashlytics dashboard.How to solve? AVFCore <redacted> Crashed: com.apple.main-thread 0 WTPlayer 0x4ca8 (missing ...
Read more >
Help with crash on iOS 14 only | Apple Developer Forums
It appears to be crashing on a background thread. I have looked for everything modifying the UI and cannot find any place we...
Read more >
I receive crash report: com.apple.main-thread - Apple Developer
I receive crash report: com.apple.main-thread · 1 CoreFoundation 0x18130ea0c -[NSMutableArray insertObjects:count:atIndex:] + 160 · 2 CoreFoundation 0x18130e744 ...
Read more >
iOS Crash Crashed: com.apple.main - Apple Developer
I have received the following crash log from Firebase Crashlytics but could not identify the exact reason. It's happing on iOS devices having...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found