iOS 15.4.0 ShareSheet _activityImage is not supported for proxies to out-of-process activities

From iOS 15.4.0 we have the crash below on Crashlytics but don't known how to reproduce and fix it. I hope someone can provide some insights to fix this.

Fatal Exception: NSGenericException 
Attempt to invoke -_activityImage on <_UIShareServiceActivityProxy_Share: 0x286935d40>, which is not supported for proxies to out-of-process activities.

Fatal Exception: NSGenericException
0  CoreFoundation                 0x99ee8 __exceptionPreprocess
1  libobjc.A.dylib                0x16704 objc_exception_throw
2  CoreFoundation                 0xf1150 __CFDictionaryCreateGeneric
3  ShareSheet                     0x77008 _UIShareServiceProxyRaiseInvocationUnsupportedForInstance
4  ShareSheet                     0x76f74 -[_UIShareServiceActivityProxy methodSignatureForSelector:]
5  CoreFoundation                 0x2e554 ___forwarding___
6  CoreFoundation                 0x2dbe0 _CF_forwarding_prep_0
7  ShareSheet                     0x4b950 -[UIActivityContentViewController _configureSharingAppCell:itemIdentifier:]
8  ShareSheet                     0x4f38 -[UIActivityContentViewController _provideCellForCollectionView:indexPath:itemIdentifier:]
9  ShareSheet                     0x4af08 __67-[UIActivityContentViewController _configureCollectionViewIfNeeded]_block_invoke
10 UIKitCore                      0x3eae0 -[__UIDiffableDataSource collectionView:cellForItemAtIndexPath:]
11 UIKitCore                      0x65cb60 -[UICollectionViewDiffableDataSource collectionView:cellForItemAtIndexPath:]
12 UIKitCore                      0x32ae60 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:]
13 UIKitCore                      0x4ded0c -[UICollectionView _recomputePreferredAttributesAsNeeded]
14 UIKitCore                      0x442c0c -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:]
15 UIKitCore                      0x88acf8 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.2339
16 UIKitCore                      0x172988 +[UIView(Animation) performWithoutAnimation:]
17 UIKitCore                      0x266f3c -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]
18 UIKitCore                      0x3e9cb0 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:]
19 UIKitCore                      0x36e8ac -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:]
20 UIKitCore                      0x85afb4 __179-[_UIDiffableDataSourceViewUpdater _performUpdateWithCollectionViewUpdateItems:dataSourceSnapshot:updateHandler:completion:viewPropertyAnimator:customAnimationsProvider:animated:]_block_invoke.35
21 UIKitCore                      0x329d84 -[UICollectionView _performInternalBatchUpdates:]
22 UIKitCore                      0x4e4de8 -[UICollectionView _performDiffableUpdate:]
23 UIKitCore                      0x98294 -[_UIDiffableDataSourceViewUpdater _performUpdateWithCollectionViewUpdateItems:dataSourceSnapshot:updateHandler:completion:viewPropertyAnimator:customAnimationsProvider:animated:]
24 UIKitCore                      0x97eec -[__UIDiffableDataSource _commitNewDataSource:withViewUpdates:viewPropertyAnimator:customAnimationsProvider:animated:commitAlongsideHandler:completion:]
25 UIKitCore                      0x35cd8c __122-[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]_block_invoke.241
26 UIKitCore                      0x856fb4 __122-[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]_block_invoke.271
27 libdispatch.dylib              0x3a2c _dispatch_client_callout
28 libdispatch.dylib              0x12c90 _dispatch_lane_barrier_sync_invoke_and_complete
29 UIKitCore                      0x31a3b8 -[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]
30 UIKitCore                      0x32f030 -[__UIDiffableDataSource applyDifferencesFromSnapshot:animatingDifferences:completion:]
31 UIKitCore                      0x2d5164 -[UICollectionViewDiffableDataSource applySnapshot:animatingDifferences:completion:]
32 ShareSheet                     0x4fe54 -[UIActivityContentViewController dataSourceManager:didPublishDataSourceWithChangeDetails:]
33 ShareSheet                     0x1ec30 -[SHSheetContentDataSourceManager updateWithChangeRequest:]
34 ShareSheet                     0x4c7fc -[UIActivityContentViewController updateContentWithPeopleProxies:shareProxies:actionProxies:activitiesByUUID:nearbyCountSlotID:animated:reloadData:]
35 ShareSheet                     0x65d20 -[SHSheetMainPresenter _updateContentView:]
36 ShareSheet                     0xe5f8 -[SHSheetMainPresenter mainInteractorDidUpdateSessionConfiguration:]
37 ShareSheet                     0x6acb8 -[SHSheetMainInteractor sessionConfigurationDidChangeForSession:]
38 ShareSheet                     0x8d3e8 -[SHSheetSession setConfiguration:]
39 ShareSheet                     0x731e8 __67-[SHSheetServiceManager dataSourceUpdatedWithSessionConfiguration:]_block_invoke
40 libdispatch.dylib              0x1e68 _dispatch_call_block_and_release
41 libdispatch.dylib              0x3a2c _dispatch_client_callout
42 libdispatch.dylib              0x11f48 _dispatch_main_queue_drain
43 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF
44 CoreFoundation                 0x52470 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
45 CoreFoundation                 0xc374 __CFRunLoopRun
46 CoreFoundation                 0x1f838 CFRunLoopRunSpecific
47 GraphicsServices               0x1374 GSEventRunModal
48 UIKitCore                      0x513f98 -[UIApplication _run]
49 UIKitCore                      0x296060 UIApplicationMain

I faced the same crash on iOS 15.4. I found my app had one custom UIActivity with computed activityImage. I just published and waiting for updates. Do you have custom UIActivity in your app?

We also have the same crash on iOS 15.4 and 15.4.1

me too, We also have the same crash on iOS 15.4 and 15.4.1

me too, We also have the same crash on iOS 15.4 and 15.4.1

I am seeing the same issue with a number of users of my app on iOS 15.4.1 (19E258). I suggest we all file a bug report to Apple.

I can confirm that the same is happening for me on iOS 15.4.1, Phone 13 Pro.

We also have the same crash on iOS 15.4 and 15.4.1

We also have the same crash on iOS 15.4 and 15.4.1.

Figured out the steps, you need to have the share sheet open, trigger an Open in App. Then go into background and back to foreground twice. Then you should run into it.

One of our applications was producing the exact same crash on production and we've made a workaround for the crash.

Go through the link and do not forget to upvote my solution if it helps you, please. 😃 https://stackoverflow.com/a/72421484/6427522

One of our applications was producing the exact same crash on production and we've made a workaround for the crash.

Go through the link and do not forget to upvote my solution if it helps you, please. 😃  Solution Link

We also have the same crash on iOS 15.4 and 15.5 and 15.6.Have you solved it,I can't reproduce the crash,I'm confused.

Hello folks, we are facing the same issues but not able to reproduce it. does anyone know how to reproduce it? We found that is happening when user open a pdf link on a WebView and it crashes, does anyone encounter same case? Thanks a lot!

We are also facing the same crash log, But we do not have any custom share activity implementation.

Seems to be un-reproducible on iOS 16 Beta Build 4.

same + 1

Same issue I am facing. + 1

iOS 15.4.0 ShareSheet _activityImage is not supported for proxies to out-of-process activities
 
 
Q