xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] Photo library crashes on iOS 16.4.1 #15742

Closed konradzuse closed 1 year ago

konradzuse commented 1 year ago

Description

Since users update to iOS 16.4.1, opening the photo library crashes the app.

Actual Behavior

Date/Time:       2023-05-11T08:58:12.999Z
Launch Time:     2023-05-11T07:55:26Z
OS Version:      iPhone OS 16.4.1 (20E252)
Report Version:  104

Exception Type:  SIGTRAP
Exception Codes: #0 at 0x1c8a6d78c
Crashed Thread:  0

Thread 0 Crashed:
0   libdispatch.dylib                    0x00000001c8a6d78c __DISPATCH_WAIT_FOR_QUEUE__ + 488
1   libdispatch.dylib                    0x00000001c8a6d2c0 _dispatch_sync_f_slow + 144
2   CoreData                             0x00000001c8c6afa0 -[NSManagedObjectContext(_NSCoreDataSPI) performWithOptions:andBlock:] + 448
3   PhotoLibraryServices                 0x00000001d66b7004 -[PLManagedObjectContext pl_performWithOptions:andBlock:] + 180
4   PhotoLibraryServices                 0x00000001d693bcf8 +[PLPhotoLibrary(MegaMocAdditions) _withDispatchGroup:onContext:synchronously:shouldSave:refreshAfterSave:performTransaction:completionHandler:] + 628
5   PhotoLibraryServices                 0x00000001d67014dc -[PLPhotoLibrary(MegaMocAdditions) performBlockAndWait:] + 92
6   AssetsLibrary                        0x0000000228c2ec1c -[ALAssetsLibrary _performBlockAndWait:] + 108
7   AssetsLibrary                        0x0000000228c30ce4 -[ALAssetsGroupPrivate _performBlockAndWait:] + 116
8   AssetsLibrary                        0x0000000228c2bd9c -[ALAssetsGroup numberOfAssets] + 156
9   Iops.Mobile.iOS                      0x0000000101a00040 0x100558000 + 21659712
10  Iops.Mobile.iOS                      0x0000000101931c94 0x100558000 + 20814996
11  Iops.Mobile.iOS                      0x000000010575a780 0x100558000 + 85993344
12  Iops.Mobile.iOS                      0x0000000100c855b0 0x100558000 + 7525808
13  Iops.Mobile.iOS                      0x0000000105e02e2c 0x100558000 + 92974636
14  Iops.Mobile.iOS                      0x0000000105ebca78 0x100558000 + 93735544
15  Iops.Mobile.iOS                      0x0000000105ec02b8 0x100558000 + 93749944
16  Iops.Mobile.iOS                      0x00000001007e3c6c 0x100558000 + 2669676
17  Iops.Mobile.iOS                      0x0000000100822d00 0x100558000 + 2927872
18  UIKitCore                            0x00000001c374e1e8 -[_UIFilteredDataSource tableView:cellForRowAtIndexPath:] + 68
19  UIKitCore                            0x00000001c374bc5c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1276
20  UIKitCore                            0x00000001c371fb2c -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 600
21  UIKitCore                            0x00000001c365a2e0 -[UITableView _updateVisibleCellsNow:] + 1096
22  UIKitCore                            0x00000001c3659dc8 -[UITableView layoutSubviews] + 144
23  UIKitCore                            0x00000001c3607ef4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1916
24  QuartzCore                           0x00000001c2ac24ac CA::Layer::layout_if_needed(CA::Transaction*) + 496
25  QuartzCore                           0x00000001c2ad5a28 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
26  QuartzCore                           0x00000001c2ae6e54 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 440
27  QuartzCore                           0x00000001c2b163c0 CA::Transaction::commit() + 644
28  QuartzCore                           0x00000001c2b00374 CA::Transaction::flush_as_runloop_observer(bool) + 84
29  UIKitCore                            0x00000001c3b005f4 _UIApplicationFlushCATransaction + 48
30  UIKitCore                            0x00000001c3c50e00 _UIUpdateSequenceRun + 80
31  UIKitCore                            0x00000001c42b4944 schedulerStepScheduledMainSection + 140
32  UIKitCore                            0x00000001c42b3ea0 runloopSourceCallback + 88
33  CoreFoundation                       0x00000001c1668208 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
34  CoreFoundation                       0x00000001c1674864 __CFRunLoopDoSource0 + 172
35  CoreFoundation                       0x00000001c15f9728 __CFRunLoopDoSources0 + 336
36  CoreFoundation                       0x00000001c160f1c4 __CFRunLoopRun + 824
37  CoreFoundation                       0x00000001c16144dc CFRunLoopRunSpecific + 608
38  GraphicsServices                     0x00000001fc87435c GSEventRunModal + 160
39  UIKitCore                            0x00000001c39a037c -[UIApplication _run] + 884
40  UIKitCore                            0x00000001c399ffe0 UIApplicationMain + 336

Basic Information

jfversluis commented 1 year ago

@konradzuse what are you using to opening the Photo library? Is this something in Essentials, are you using custom code?

Essaadani commented 1 year ago

Hi Gerald,

I am experiencing the same problem in Production using iPadOS 16.4.1 and iOS 16.5. In my situation, I am utilizing the FilePicker from the Xam.Plugin.Media nuget package.

jfversluis commented 1 year ago

@Essaadani if the code in that plugin is crashing, you probably want to report it on that repo. We don't have any code in Forms that works with the Photo library directly and no response from the author, so closing this here for now as there isn't much we can do.