According to our crash analytics, the application crashes when trying to share a PDF file in the UIDocumentInteractionController. This crash takes place on iOS 26+ only.
Based on analytics, user sessions end when the pdf file is opened in the UIDocumentInteractionController. We couldn't reproduce it on a physical device or a simulator.
Can you please help with a fix or at least workaround for this issue? What's your opinion for bug localization (application or framework)?
Crash log is attached below.
CoreFoundation __exceptionPreprocess + 164
libobjc.A.dylib objc_exception_throw + 88
CoreFoundation -[__NSArrayM insertObject:atIndex:] + 1276
ShareSheet __79-[SHSheetActivityItemsManager loadItemProvidersForRequest:activity:completion:]_block_invoke + 972
ShareSheet __79-[_UIShareServiceActivityProxy _loadItemProvidersFromActivityItems:completion:]_block_invoke + 88
ShareSheet __74+[UIActivity _loadItemProvidersFromActivityItems:withCacheURL:completion:]_block_invoke_4 + 352
libdispatch.dylib _dispatch_call_block_and_release + 32
libdispatch.dylib _dispatch_main_queue_drain.cold.5 + 812
libdispatch.dylib _dispatch_main_queue_drain + 180
CoreFoundation __CFRunLoopRun + 1944
The stack you've posted is entirely within the ShareSheet framework — no app frames are visible. -[__NSArrayM insertObject:atIndex:] + 1276 is the code path that throws NSInvalidArgumentException when you pass a nil object, so something inside SHSheetActivityItemsManager loadItemProvidersForRequest:activity:completion: is receiving a nil item provider for one of the activity items and adding it to an array without a nil check. That suggests a framework issue, but I'll need more to be confident. It's also possible that the specific item you're passing to UIDocumentInteractionController is what triggers the nil-provider path.
A few things would help narrow this down:
-
A full
.ipscrash report. Beyond the top frames, the thread that crashed, the other threads' states, and the binary images list all matter for diagnosis. The exception reason string matters most — the "*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '...'" line that usually precedes this kind of stack. That reason string often names what was nil. -
The specific iOS 26.x point releases where you're seeing this. Is it every 26.x build, or did it start at a particular one?
-
How you're configuring and presenting the
UIDocumentInteractionController: the source of the file URL (bundled resource, downloaded file, file picked usingUIDocumentPickerViewController, security-scoped, and so on), whether you setutiexplicitly, and whichpresent…method you're calling. -
The rate you see this in your analytics. Is it a small fraction of share attempts or most of them?
Once you have a complete .ips, please share it here and file a Feedback report with it attached — without one, engineering doesn't have enough to investigate. If you can, attach more than one sample, because variation across crashes often reveals whether the trigger is a specific file type, a specific URL shape, or something environmental. If you do file, please post the FB number here so I can reference it.