Telerik-Verified-Plugins / ImagePicker

Cordova Plugin For Multiple Image Selection
MIT License
181 stars 328 forks source link

Crashes on ios 15.5 #254

Open gchokeen opened 1 year ago

gchokeen commented 1 year ago

I tested this plugin in ios simulator ios 12, ios 15.2 but when I test in real device iphone x (ios 15.5), it crashed the app. I have attached the full error log.


Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.MyApp.photo>:4949] failed to terminate gracefully after 5.0s
ProcessVisibility: Background
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 10.760 (user 10.760, system 0.000), 35% CPU",
"Elapsed application CPU time (seconds): 0.084, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

crashlog.txt

Ionic:

   Ionic CLI                     : 6.19.0 (/.nvm/versions/node/v14.17.3/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.1.3
   @angular-devkit/build-angular : 13.2.6
   @angular-devkit/schematics    : 13.2.6
   @angular/cli                  : 13.2.6
   @ionic/angular-toolkit        : 6.1.0

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 9 other plugins)

Utility:

   cordova-res                          : 0.15.4
   native-run (update available: 1.6.0) : 1.5.0

System:

   Android SDK Tools : 26.1.1 (/Library/Android/sdk)
   ios-deploy        : 1.11.4
   ios-sim           : 8.0.2
   NodeJS            : v14.17.3 (/.nvm/versions/node/v14.17.3/bin/node)
   npm               : 6.14.13
   OS                : macOS Big Sur
   Xcode             : Xcode 13.2.1 Build version 13C100

It's a simple code

pickFromGallery() {

        let options = {
            maximumImagesCount: 5,
            quality: 100
        }

        this.imagePicker.getPictures(options).then((results) => {

            for (var i = 0; i < results.length; i++) {
                console.log('Image URI: ' + results[i]);
            }

            this.uploadFile(results);

        }, (err) => {

            console.log(err);
        });
    }

Hope I will get some help!

gchokeen commented 1 year ago

I tried to use this pull request https://github.com/Telerik-Verified-Plugins/ImagePicker/pull/247 Now gallery selection is opened, but crashed again for different reason


Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<com.MyApp.photo>:5555 exhausted real (wall clock) time allowance of 10.00 seconds
ProcessVisibility: Background
ProcessState: Running
WatchdogEvent: scene-update
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 21.490 (user 21.490, system 0.000), 36% CPU",
"Elapsed application CPU time (seconds): 0.226, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000021ee7f4a0 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000021ee7fae4 mach_msg + 76 (mach_msg.c:119)
2   libdispatch.dylib               0x00000001e70cb678 _dispatch_mach_send_and_wait_for_reply + 540 (mach.c:815)
3   libdispatch.dylib               0x00000001e70cba00 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:1973)
4   libxpc.dylib                    0x00000002585d3f0c xpc_connection_send_message_with_reply_sync + 240 (connection.c:974)
5   Foundation                      0x00000001e8be3c6c __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16 (NSXPCConnection.m:223)
6   Foundation                      0x00000001e8be9d3c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2540 (NSXPCConnection.m:1649)
7   Foundation                      0x00000001e8c2356c -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:] + 144 (NSXPCConnection.m:1287)
8   Foundation                      0x00000001e8c3822c _NSXPCDistantObjectSimpleMessageSend2 + 76 (NSXPCDistantObject.m:272)
9   CoreData                        0x00000001eec56d80 -[NSXPCStoreConnection sendMessage:store:error:] + 372 (NSXPCStoreConnection.m:162)
10  CoreData                        0x00000001eecc432c -[NSXPCStoreConnection sendMessageWithContext:] + 48 (NSXPCStoreConnection.m:208)
11  CoreData                        0x00000001eec56174 __54-[NSXPCStoreConnectionManager sendMessageWithContext:]_block_invoke + 92 (NSXPCStoreConnectionManager.m:145)
12  libdispatch.dylib               0x00000001e70b0a30 _dispatch_client_callout + 20 (object.m:560)
13  libdispatch.dylib               0x00000001e70c02d4 _dispatch_sync_invoke_and_complete + 56 (queue.c:1028)
14  CoreData                        0x00000001eecb4514 -[NSXPCStoreConnectionManager sendMessageWithContext:] + 112 (NSXPCStoreConnectionManager.m:136)
15  CoreData                        0x00000001eec4d634 -[NSXPCStore sendMessage:fromContext:interrupts:error:] + 372 (NSXPCStore.m:414)
16  CoreData                        0x00000001eec32870 -[NSXPCStore executeFetchRequest:withContext:error:] + 700 (NSXPCStore.m:1034)
17  CoreData                        0x00000001eeca4e4c -[NSXPCStore executeRequest:withContext:error:] + 148 (NSXPCStore.m:1416)
18  CoreData                        0x00000001eed66af8 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.819 + 5340 (NSPersistentStoreCoordinator.m:2963)
19  CoreData                        0x00000001eebc9298 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 264 (NSPersistentStoreCoordinator.m:606)
20  CoreData                        0x00000001eebfa58c -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1248 (NSPersistentStoreCoordinator.m:2737)
21  CoreData                        0x00000001eebbf924 -[NSManagedObjectContext executeFetchRequest:error:] + 924 (NSManagedObjectContext.m:2243)
22  PhotoLibraryServices            0x00000001fb450e94 -[PLManagedObjectContext pl_executeFetchRequest:error:] + 284 (PLManagedObjectContext.m:561)
23  PhotoLibraryServices            0x00000001fb46d928 -[PLManagedObjectContext executeFetchRequest:error:] + 108 (PLManagedObjectContext.m:545)
24  Photos                          0x00000001fb1b1138 __55+[PHFetchResult fetchObjectIDs:inManagedObjectContext:]_block_invoke + 228 (PHFetchResult.m:295)
25  PhotoLibraryServices            0x00000001fb635a40 __46-[PLManagedObjectContext performBlockAndWait:]_block_invoke + 96 (PLManagedObjectContext.m:710)
26  CoreData                        0x00000001eebbe27c developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3942)
27  libdispatch.dylib               0x00000001e70b0a30 _dispatch_client_callout + 20 (object.m:560)
28  libdispatch.dylib               0x00000001e70bfc90 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1028)
29  CoreData                        0x00000001eebbe4dc -[NSManagedObjectContext performBlockAndWait:] + 264 (NSManagedObjectContext.m:4059)
30  PhotoLibraryServices            0x00000001fb6359c0 -[PLManagedObjectContext performBlockAndWait:] + 148 (PLManagedObjectContext.m:708)
31  Photos                          0x00000001fb19eda0 +[PHFetchResult fetchObjectIDs:inManagedObjectContext:] + 428 (PHFetchResult.m:292)
32  Photos                          0x00000001fb19ae88 __57-[PHFetchResult fetchedObjectsUsingManagedObjectContext:]_block_invoke + 196 (PHFetchResult.m:462)
33  PhotoLibraryServicesCore        0x000000026309b190 __pl_dispatch_sync_block_invoke + 44 (PLDispatchHelpers.m:20)
34  libdispatch.dylib               0x00000001e70b0a30 _dispatch_client_callout + 20 (object.m:560)
35  libdispatch.dylib               0x00000001e70bfc90 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1028)
36  PhotoLibraryServicesCore        0x000000026309b2f0 pl_dispatch_sync + 124 (PLDispatchHelpers.m:20)
37  Photos                          0x00000001fb1ad3e0 -[PHFetchResult fetchedObjectsUsingManagedObjectContext:] + 132 (PHFetchResult.m:457)
38  Photos                          0x00000001fb1a6ec4 -[PHFetchResult initWithQuery:oids:registerIfNeeded:usingManagedObjectContext:] + 716 (PHFetchResult.m:85)
39  Photos                          0x00000001fb1a3cd4 -[PHFetchResult initWithQuery:] + 96 (PHFetchResult.m:96)
40  Photos                          0x00000001fb1aa808 __23-[PHQuery executeQuery]_block_invoke + 48 (PHQuery.m:871)
41  Photos                          0x00000001fb33552c PHQueryForAssetsInAlbum_SortKeyCreationDate_block_invoke_83 + 212 (PHQuery.m:3990)
42  Photos                          0x00000001fb19c7e4 -[PHQuery executeQuery] + 124 (PHQuery.m:870)
43  Photos                          0x00000001fb1a8718 +[PHAsset fetchAssetsInAssetCollection:options:] + 888 (PHAsset.m:3023)
44  Bilancio                        0x0000000102953550 -[GMAlbumsViewController updateFetchResults] + 992 (GMAlbumsViewController.m:182)
45  Bilancio                        0x000000010295306c -[GMAlbumsViewController viewDidLoad] + 1996 (GMAlbumsViewController.m:129)
46  UIKitCore                       0x00000001e99d5e34 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 108 (UIViewController.m:2733)
47  UIKitCore                       0x00000001e99d8984 -[UIViewController loadViewIfRequired] + 1048 (UIViewController.m:4042)
48  UIKitCore                       0x00000001e9ad7ff8 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 176 (UINavigationController.m:7262)
49  UIKitCore                       0x00000001e9ad46d8 -[UINavigationController _startTransition:fromViewController:toViewController:] + 196 (UINavigationController.m:7297)
50  UIKitCore                       0x00000001e9cff1e8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 868 (UINavigationController.m:7523)
51  UIKitCore                       0x00000001e9bd48e4 -[UINavigationController __viewWillLayoutSubviews] + 168 (UINavigationController.m:7835)
52  UIKitCore                       0x00000001e9afc2dc -[UILayoutContainerView layoutSubviews] + 228 (UILayoutContainerView.m:88)
53  UIKitCore                       0x00000001e99b5fb4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592 (UIView.m:18426)
54  QuartzCore                      0x00000001eb12ccd0 CA::Layer::layout_if_needed(CA::Transaction*) + 532 (CALayer.mm:10116)
55  UIKitCore                       0x00000001e9a19d90 -[UIView(Hierarchy) layoutBelowIfNeeded] + 584 (UIView.m:12868)
56  UIKitCore                       0x00000001e9b9ebd0 -[UISheetPresentationController _sheetLayoutInfoLayout:] + 52 (UISheetPresentationController.m:1111)
57  UIKitCore                       0x00000001e9b38dc0 -[_UISheetLayoutInfo _layout] + 336 (_UISheetMetrics.m:3544)
58  UIKitCore                       0x00000001e9af47fc __54-[UISheetPresentationController _transitionWillBegin:]_block_invoke_2 + 56 (UISheetPresentationController.m:1512)
59  UIKitCore                       0x00000001e999c7e0 +[UIView(Animation) performWithoutAnimation:] + 104 (UIView.m:14609)
60  UIKitCore                       0x00000001ea937ee4 __54-[UISheetPresentationController _transitionWillBegin:]_block_invoke.531 + 168 (UISheetPresentationController.m:1511)
61  UIKitCore                       0x00000001e9a979b4 -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 280 (UIViewControllerTransitioning.m:1148)
62  UIKitCore                       0x00000001e9d4e8b8 -[_UIViewControllerTransitionContext __runAlongsideAnimations] + 324 (UIViewControllerTransitioning.m:419)
63  UIKitCore                       0x00000001e9a9e040 __63+[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:]_block_invoke + 36 (UIView.m:14560)
64  UIKitCore                       0x00000001e9da92c8 -[UIViewAnimationState _runAlongsideAnimations] + 40 (UIView.m:2016)
65  UIKitCore                       0x00000001e9decf60 -[UIViewAnimationState pop] + 56 (UIView.m:1749)
66  UIKitCore                       0x00000001e9a9b81c +[UIViewAnimationState popAnimationState] + 68 (UIView.m:1084)
67  UIKitCore                       0x00000001e99aef14 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 736 (UIView.m:15122)
68  UIKitCore                       0x00000001eaac52b8 __50-[UITransitionView _startTransition:withDuration:]_block_invoke.179 + 184 (UITransitionView.m:579)
69  UIKitCore                       0x00000001e9aa0364 +[UIView(UIViewAnimationWithBlocks) conditionallyAnimate:withAnimation:layout:completion:] + 96 (UIView.m:15204)
70  UIKitCore                       0x00000001e9b6b230 -[UITransitionView _startTransition:withDuration:] + 776 (UITransitionView.m:577)
71  UIKitCore                       0x00000001e9a9f3c0 -[UITransitionView transition:fromView:toView:removeFromView:] + 2564 (UITransitionView.m:480)
72  UIKitCore                       0x00000001e9b026e0 -[UIViewControllerBuiltinTransitionViewAnimator animateTransition:] + 1604 (UIViewControllerBuiltinTransitionViewAnimator.m:191)
73  UIKitCore                       0x00000001e9cdf7a4 ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2 + 76 (UIViewControllerTransitioning.m:0)
74  UIKitCore                       0x00000001e9b0bf38 +[UIKeyboardSceneDelegate _pinInputViewsForKeyboardSceneDelegate:onBehalfOfResponder:duringBlock:] + 116 (UIKeyboardSceneDelegate.m:2023)
75  UIKitCore                       0x00000001ea1d9a94 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.663 + 204 (UIViewControllerTransitioning.m:1258)
76  UIKitCore                       0x00000001e9c0ee7c +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:] + 204 (UIView.m:14564)
77  UIKitCore                       0x00000001e9aa5178 _UIViewControllerTransitioningRunCustomTransition + 628 (UIViewControllerTransitioning.m:1249)
78  UIKitCore                       0x00000001e9ee5714 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.424 + 2208 (UIPresentationController.m:1238)
79  UIKitCore                       0x00000001e9b524dc -[_UIAfterCACommitBlock run] + 72 (_UIAfterCACommitQueue.m:137)
80  UIKitCore                       0x00000001e9a65864 -[_UIAfterCACommitQueue flush] + 192 (_UIAfterCACommitQueue.m:228)
81  UIKitCore                       0x00000001e998f074 _runAfterCACommitDeferredBlocks + 644 (UIApplication.m:3038)
82  UIKitCore                       0x00000001e998f798 _cleanUpAfterCAFlushAndRunDeferredBlocks + 132 (UIApplication.m:3002)
83  UIKitCore                       0x00000001e998f948 _afterCACommitHandler + 60 (UIApplication.m:3053)
84  CoreFoundation                  0x00000001e73f10c4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1804)
85  CoreFoundation                  0x00000001e73c0080 __CFRunLoopDoObservers + 592 (CFRunLoop.c:1917)
86  CoreFoundation                  0x00000001e73bb13c __CFRunLoopRun + 1052 (CFRunLoop.c:2979)
87  CoreFoundation                  0x00000001e73cebc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
88  GraphicsServices                0x0000000203502374 GSEventRunModal + 164 (GSEvent.c:2200)
89  UIKitCore                       0x00000001e9d3e648 -[UIApplication _run] + 1100 (UIApplication.m:3511)
90  UIKitCore                       0x00000001e9abfd90 UIApplicationMain + 364 (UIApplication.m:5064)
91  Bilancio                        0x0000000102925330 main + 56 (main.m:32)
92  dyld                            0x0000000102bd1ce4 start + 520 (dyldMain.cpp:879)
gchokeen commented 1 year ago

Ok crash happened when selecting, "Allow access to All the photos". So when user has lots image it crash due to memory! If we select select images first option it works fine. Is there any fix for that?

image
gchokeen commented 1 year ago

Could be related to this issue: https://developer.apple.com/forums/thread/696804