Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios crash while using in background #4352

Closed
rouddy opened this issue Oct 19, 2022 · 4 comments
Closed

ios crash while using in background #4352

rouddy opened this issue Oct 19, 2022 · 4 comments
Labels
bug Something isn't working closing soon mobile client Issues related to AWSMobileClient pending-community-response Issue is pending response from the issue requestor

Comments

@rouddy
Copy link

rouddy commented Oct 19, 2022

Describe the bug

application crashed while using in background.

crash report says

Unexpectedly found nil while unwrapping an Optional

when calls AWSMobileClient.getViewController() and it started from AWSMobileClient.internalSignOut
i did clearly not sign out from ui.
i using amplify for posting data to our api gateway server, and we acquire id token from cognito.
and crash occurs in background when application not on front.

i don't understand why internalSignOut called?
and in background view controller is nil and unwrapping an optional have to be avoided.

additionally i using cocoapods in flutter project.
because amplify-flutter does not support sign in with social using custom oidc provider.

here's full report from app store.

Log Messages
Incident Identifier: 45140F06-17DD-4AA5-9D48-6DAEE1405E48
Hardware Model:      iPhone12,8
Process:             Runner [5688]
Path:                /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Runner
Identifier:          com.algorigo.jasealgoFlutter.stage
Version:             1.1.0 (13)
AppStoreTools:       14A305
AppVariant:          1:iPhone12,8:16
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.algorigo.jasealgoFlutter.stage [520]

Date/Time:           2022-10-19 10:00:16.9949 +0900
Launch Time:         2022-10-19 08:45:03.6777 +0900
OS Version:          iPhone OS 16.0.3 (20A392)
Release Type:        User
Baseband Version:    4.00.00
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010067bd68
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [5688]

Triggered by Thread:  0


Kernel Triage:
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage


Thread 0 name:
Thread 0 Crashed:
0   AWSMobileClient               	0x000000010067bd68 Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value + 0 (AWSMobileClient+SignInUI.swift:0)
1   AWSMobileClient               	0x000000010067bd68 AWSMobileClient.getViewController() + 276 (AWSMobileClient+SignInUI.swift:283)
2   AWSMobileClient               	0x000000010067bd28 AWSMobileClient.getViewController() + 212 (<compiler-generated>:0)
3   AWSMobileClient               	0x000000010067bd90 @objc AWSMobileClient.getViewController() + 28 (<compiler-generated>:0)
4   AWSMobileClient               	0x000000010065c66c -[AWSCognitoAuth signOut:] + 96 (AWSCognitoAuth.m:549)
5   AWSMobileClient               	0x000000010067f6d4 AWSMobileClient.hostedUILegacySignOut(completionHandler:) + 264 (AWSMobileClient+SignOut.swift:178)
6   AWSMobileClient               	0x000000010067f5b4 closure aws-amplify/amplify-swift#1 in AWSMobileClient.internalSignOut(presentationAnchor:options:completionHandler:) + 340 (<compiler-generated>:0)
7   AWSMobileClient               	0x000000010067e734 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
8   libdispatch.dylib             	0x000000019c34c4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
9   libdispatch.dylib             	0x000000019c34dfdc _dispatch_client_callout + 20 (object.m:560)
10  libdispatch.dylib             	0x000000019c35c7f4 _dispatch_main_queue_drain + 928 (inline_internal.h:2632)
11  libdispatch.dylib             	0x000000019c35c444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887)
12  CoreFoundation                	0x0000000194f62a08 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1797)
13  CoreFoundation                	0x0000000194f44368 __CFRunLoopRun + 2036 (CFRunLoop.c:3164)
14  CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
15  GraphicsServices              	0x00000001cdd69368 GSEventRunModal + 164 (GSEvent.c:2196)
16  UIKitCore                     	0x00000001973f8d88 -[UIApplication _run] + 888 (UIApplication.m:3726)
17  UIKitCore                     	0x00000001973f89ec UIApplicationMain + 340 (UIApplication.m:5316)
18  Runner                        	0x00000001002058ec main + 64 (AppDelegate.swift:7)
19  dyld                          	0x00000001b326d948 start + 2504 (dyldMain.cpp:1168)

Thread 1:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 2 name:
Thread 2:
0   CoreFoundation                	0x0000000194f4a1a4 CFStringGetLength + 100 (CFInternal.h:982)
1   CoreFoundation                	0x0000000194ed6f60 CFStringFindWithOptionsAndLocale + 88 (CFString.c:3563)
2   CoreFoundation                	0x0000000194f07ed0 _CFURLCreateWithFileSystemPath + 156 (CFURL.c:5156)
3   Foundation                    	0x000000018f378280 +[NSURL(NSURL) fileURLWithPath:isDirectory:] + 40 (NSURL.m:814)
4   Foundation                    	0x000000018f396970 +[NSFileAttributes _attributesAtPath:partialReturn:filterResourceFork:error:] + 264 (NSFileManager.m:1011)
5   Foundation                    	0x000000018f366de0 -[NSFileManager enumeratorAtPath:] + 36 (NSFileManager.m:4307)
6   GoogleDataTransport           	0x0000000101d25ab4 __55-[GDTCORFlatFileStorage hasEventsForTarget:onComplete:]_block_invoke + 164 (GDTCORFlatFileStorage.m:392)
7   libdispatch.dylib             	0x000000019c34c4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
8   libdispatch.dylib             	0x000000019c34dfdc _dispatch_client_callout + 20 (object.m:560)
9   libdispatch.dylib             	0x000000019c355694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
10  libdispatch.dylib             	0x000000019c3561e0 _dispatch_lane_invoke + 384 (queue.c:3940)
11  libdispatch.dylib             	0x000000019c360e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
12  libsystem_pthread.dylib       	0x00000001e17f0df8 _pthread_wqthread + 288 (pthread.c:2618)
13  libsystem_pthread.dylib       	0x00000001e17f0b98 start_wqthread + 8

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000194f42e00 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2639)
5   CoreFoundation                	0x0000000194f44044 __CFRunLoopRun + 1232 (CFRunLoop.c:3022)
6   CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
7   Foundation                    	0x000000018f359818 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x000000018f359700 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x000000019752d88c -[UIEventFetcher threadMain] + 436 (UIEventFetcher.m:1212)
10  Foundation                    	0x000000018f372ce8 __NSThread__start__ + 716 (NSThread.m:968)
11  libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
12  libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 4:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000194f42e00 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2639)
5   CoreFoundation                	0x0000000194f44044 __CFRunLoopRun + 1232 (CFRunLoop.c:3022)
6   CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
7   Flutter                       	0x000000010291d094 0x102624000 + 3117204
8   Flutter                       	0x000000010291ca94 0x102624000 + 3115668
9   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000194f42e00 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2639)
5   CoreFoundation                	0x0000000194f44044 __CFRunLoopRun + 1232 (CFRunLoop.c:3022)
6   CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
7   Flutter                       	0x000000010291d094 0x102624000 + 3117204
8   Flutter                       	0x000000010291ca94 0x102624000 + 3115668
9   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000194f42e00 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2639)
5   CoreFoundation                	0x0000000194f44044 __CFRunLoopRun + 1232 (CFRunLoop.c:3022)
6   CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
7   Flutter                       	0x000000010291d094 0x102624000 + 3117204
8   Flutter                       	0x000000010291ca94 0x102624000 + 3115668
9   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 10 name:
Thread 10:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 11 name:
Thread 11:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 12 name:
Thread 12:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 13 name:
Thread 13:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 14 name:
Thread 14:
0   libsystem_kernel.dylib        	0x00000001d15b441c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	0x00000001e17f806c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001a3272acc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000102917808 0x102624000 + 3094536
4   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 15 name:
Thread 15:
0   libsystem_kernel.dylib        	0x00000001d15b5480 kevent + 8
1   Flutter                       	0x0000000102b0845c 0x102624000 + 5129308
2   Flutter                       	0x0000000102b37544 0x102624000 + 5322052
3   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
4   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 16:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 17 name:
Thread 17:
0   GoogleUtilities               	0x0000000101d93780 objc_msgSend$count + 0
1   GoogleUtilities               	0x0000000101d8bf8c -[GULNetwork hasUploadInProgress] + 16 (GULNetwork.m:242)
2   Runner                        	0x00000001002530e0 -[APMMeasurement isNetworkReadyForRequest] + 32
3   Runner                        	0x00000001002523e0 -[APMMeasurement uploadData] + 192
4   Runner                        	0x0000000100251d9c __32-[APMMeasurement updateSchedule]_block_invoke_2 + 36
5   Runner                        	0x00000001002a627c __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
6   libdispatch.dylib             	0x000000019c34c4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
7   libdispatch.dylib             	0x000000019c34dfdc _dispatch_client_callout + 20 (object.m:560)
8   libdispatch.dylib             	0x000000019c355694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
9   libdispatch.dylib             	0x000000019c3561e0 _dispatch_lane_invoke + 384 (queue.c:3940)
10  libdispatch.dylib             	0x000000019c360e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
11  libsystem_pthread.dylib       	0x00000001e17f0df8 _pthread_wqthread + 288 (pthread.c:2618)
12  libsystem_pthread.dylib       	0x00000001e17f0b98 start_wqthread + 8

Thread 18 name:
Thread 18:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   FirebaseCrashlytics           	0x0000000101b90d90 FIRCLSMachExceptionReply + 100 (FIRCLSMachException.c:258)
5   FirebaseCrashlytics           	0x0000000101b90d90 FIRCLSMachExceptionServer + 940 (FIRCLSMachException.c:176)
6   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 19:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 20:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 21 name:
Thread 21:
0   libsystem_kernel.dylib        	0x00000001d15b3b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	0x00000001d15c6008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d15c6248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d15b408c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x0000000194f42e00 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2639)
5   CoreFoundation                	0x0000000194f44044 __CFRunLoopRun + 1232 (CFRunLoop.c:3022)
6   CoreFoundation                	0x0000000194f491e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
7   CFNetwork                     	0x0000000196297bac +[__CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1372)
8   Foundation                    	0x000000018f372ce8 __NSThread__start__ + 716 (NSThread.m:968)
9   libsystem_pthread.dylib       	0x00000001e17f16cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e17f0ba4 thread_start + 8

Thread 22:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 23:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 24:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0

Thread 25:
0   libsystem_pthread.dylib       	0x00000001e17f0b90 start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000103904b50   x1: 0x08000001eb118f37   x2: 0x00000001eb118f30   x3: 0x0000000000000001
    x4: 0x0000000000000074   x5: 0x0000000000000074   x6: 0x0000000282655650   x7: 0x00000000ffffffff
    x8: 0x00000001eb0aa260   x9: 0x0000000000000004  x10: 0x00000001f2d612e8  x11: 0x0000000000000000
   x12: 0x00000000007922c6  x13: 0x0000000107e49390  x14: 0x00000001eb10c028  x15: 0x00000001eb10c028
   x16: 0x08000001eb118f37  x17: 0x000000000000000e  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x0000000103904b50  x21: 0x0000000103a06ad0  x22: 0x00000002826555c0  x23: 0x0000000282655650
   x24: 0x0000000000000000  x25: 0x00000001eb0aa260  x26: 0x0000000283d78040  x27: 0x000000000000000f
   x28: 0x0000000000000000   fp: 0x000000016fbfe590   lr: 0x000000010067bd28
    sp: 0x000000016fbfe570   pc: 0x000000010067bd68 cpsr: 0x60000000
   esr: 0xf2000001 (Breakpoint) brk 1


Binary Images:
0x100200000 - 0x10046ffff Runner arm64  <0e8d230701e53322abaf9f3bb0425451> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Runner
0x100654000 - 0x1006affff AWSMobileClient arm64  <5ae25bc4cfcb388b833ed91879d8aa98> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Frameworks/AWSMobileClient.framework/AWSMobileClient
0x101b78000 - 0x101bbbfff FirebaseCrashlytics arm64  <cb4a8faacc8836ada16cfc2cd258d8eb> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Frameworks/FirebaseCrashlytics.framework/FirebaseCrashlytics
0x101d18000 - 0x101d3bfff GoogleDataTransport arm64  <66e9686d00923e7796f238cceb5e9d17> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport
0x101d80000 - 0x101d9bfff GoogleUtilities arm64  <48339d534bbe38eba2fcaf70300e144b> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Frameworks/GoogleUtilities.framework/GoogleUtilities
0x102624000 - 0x102e0ffff Flutter arm64  <06c0b1046d24347198d4326e87347d68> /private/var/containers/Bundle/Application/F62A8B01-D8C0-4FEA-A950-8E4C20FCC6B9/Runner.app/Frameworks/Flutter.framework/Flutter
0x18f318000 - 0x18fc62fff Foundation arm64e  <aa92cd58561a341492f4b4120298b39a> /System/Library/Frameworks/Foundation.framework/Foundation
0x194ec8000 - 0x1952acfff CoreFoundation arm64e  <42c5c91704473995b50fde4d132c2435> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x196043000 - 0x196408fff CFNetwork arm64e  <35605de33723335a83d96f35f2989935> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x197056000 - 0x19881cfff UIKitCore arm64e  <7b942fa4cb7633759972f58c14492fb4> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x19c34a000 - 0x19c390fff libdispatch.dylib arm64e  <c663d847b94f3fb0925432edbc55315e> /usr/lib/system/libdispatch.dylib
0x1a3266000 - 0x1a32ccff3 libc++.1.dylib arm64e  <36bf5e0c2d4036faa0752476613f6d3f> /usr/lib/libc++.1.dylib
0x1b3258000 - 0x1b32dae4f dyld arm64e  <7aa46eb180b2342b9e99be07dbd5696c> /usr/lib/dyld
0x1cdd68000 - 0x1cdd70fff GraphicsServices arm64e  <03732ba5113235b4b09d8dd49807d246> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1d15b3000 - 0x1d15e9ffb libsystem_kernel.dylib arm64e  <d3eb8b567c223265a985a436bc8caf15> /usr/lib/system/libsystem_kernel.dylib
0x1e17f0000 - 0x1e17fbfff libsystem_pthread.dylib arm64e  <e0674d941a2936b9a1f9ca129f0cfc7e> /usr/lib/system/libsystem_pthread.dylib

EOF

Steps To Reproduce

i cannot reproduce for purpose.

Expected behavior

getViewController can be nil.
unwrapping the optional should be checked.

Amplify Framework Version

1.2.8

Amplify Categories

Auth

Dependency manager

Cocoapods

Swift version

5.1

CLI version

1.2.8

Xcode version

13.4.1

Is this a regression?

No

Regression additional context

No response

Device

iPhone SE2

iOS Version

16.0.3

Specific to simulators

No response

Additional context

No response

@royjit royjit transferred this issue from aws-amplify/amplify-swift Oct 19, 2022
@atierian atierian self-assigned this Oct 21, 2022
@atierian
Copy link
Member

Hi @rouddy, thanks for opening this issue.
You mentioned that you're using Amplify Version 1.2.8, does that refer to Amplify iOS 1.28.0?
Can you also please post your Podfile? That will help us in attempting to reproduce and diagnose the issue.

Thanks.

@atierian atierian added the pending-community-response Issue is pending response from the issue requestor label Oct 21, 2022
@royjit royjit added mobile client Issues related to AWSMobileClient and removed auth labels Oct 24, 2022
@rouddy
Copy link
Author

rouddy commented Oct 25, 2022

sorry, it was typo. 1.28.0 is correct.

here's my amplify part of my pod.

  s.dependency      'Amplify', '~> 1.28.0'
  s.dependency      'AmplifyPlugins/AWSCognitoAuthPlugin', '1.28.0'
  s.dependency      'AmplifyPlugins/AWSS3StoragePlugin', '1.28.0'

as i mentioned, i'm using flutter framework and native library of amplify.
here's full pod files

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint algo_platform_jsag.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
  s.name             = 'algo_platform_jsag'
  s.version          = '0.0.1'
  s.summary          = 'A new Flutter project.'
  s.description      = <<-DESC
A new Flutter project.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => '[email protected]' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.dependency 'Flutter'
  s.platform = :ios, '11.0'
  s.resources = 'Assets/*'

  # Flutter.framework does not contain a i386 slice.
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
  s.swift_version = '5.1'

  s.framework       = 'CoreBluetooth'
  s.dependency      'AlgorigoBleLibrary', '~> 0.2.2'
  s.dependency      'TensorFlowLiteSwift', '~> 2.0.0'
  s.dependency      'Amplify', '~> 1.28.0'
  s.dependency      'AmplifyPlugins/AWSCognitoAuthPlugin', '1.28.0'
  s.dependency      'AmplifyPlugins/AWSS3StoragePlugin', '1.28.0'
  s.dependency      'Moya', '~> 15.0.0'
  s.dependency      'Moya/RxSwift', '~> 15.0.0'
  s.static_framework = true

end
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

  target 'algo_platform_jsag_exampleTests' do
    use_frameworks!
    use_modular_headers!

    pod 'RxBlocking', '~> 6.5.0'
    pod 'RxTest', '~> 6.5.0'
    
    flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
  installer.pods_project.build_configurations.each do |config|
    if config.name == 'Debug Live'
      config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D LIVE']
      config.build_settings['ENABLE_TESTABILITY'] = 'YES'
    elsif config.name == 'Debug Stage'
      config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D STAGE']
      config.build_settings['ENABLE_TESTABILITY'] = 'YES'
    elsif config.name == 'Debug Dev'
      config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D DEV']
      config.build_settings['ENABLE_TESTABILITY'] = 'YES'
    end
  end
end

@atierian atierian added investigating This issue is being investigated and removed pending-community-response Issue is pending response from the issue requestor labels Oct 28, 2022
@atierian atierian removed their assignment Feb 24, 2023
@harsh62
Copy link
Member

harsh62 commented Oct 3, 2023

Apologies for the delay. Our team is actively prioritizing and working on issues. We will provide an update as soon as we have one on the issue.

@atierian
Copy link
Member

and crash occurs in background when application not on front.

It sounds like you're calling this while your app is in the background. You'll need to ensure the app is in the foreground before calling getViewController()

If that's not the case, there may be something unexpected happening in the app lifecycle due to using Flutter.

@atierian atierian added pending-community-response Issue is pending response from the issue requestor closing soon and removed investigating This issue is being investigated labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closing soon mobile client Issues related to AWSMobileClient pending-community-response Issue is pending response from the issue requestor
Projects
None yet
Development

No branches or pull requests

5 participants