Flutter Application crashes on ios when changing tab of DefaultTabBarController - ios

MY application consist of both bottom and upper tabs, I am calling a network request on each tab but sometimes it crash application on iOS and don't know the reason for this.
Below are logs i got on crashlytics.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x199a9b180 __exceptionPreprocess
1 libobjc.A.dylib 0x198c739f8 objc_exception_throw
2 CoreFoundation 0x1999b488c +[_CFXNotificationTokenRegistration keyCallbacks]
3 Foundation 0x19a478b38 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 Flutter 0x1014953ec (Missing)
5 Runner 0x101062c30 +[GeneratedPluginRegistrant registerWithRegistry:] + 88 (GeneratedPluginRegistrant.m:88)
6 flutter_downloader 0x101f77404 (Missing)
7 flutter_downloader 0x101f7a850 (Missing)
8 flutter_downloader 0x101f7d218 (Missing)
9 Flutter 0x101517768 (Missing)
10 Flutter 0x1014b2240 (Missing)
11 Flutter 0x101508398 (Missing)
12 Flutter 0x1014c1fd0 (Missing)
13 Flutter 0x1014c3c48 (Missing)
14 CoreFoundation 0x199a2d554 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
15 CoreFoundation 0x199a2d284 __CFRunLoopDoTimer
16 CoreFoundation 0x199a2cab8 __CFRunLoopDoTimers
17 CoreFoundation 0x199a27a08 __CFRunLoopRun
18 CoreFoundation 0x199a26fb4 CFRunLoopRunSpecific
19 GraphicsServices 0x19bc2879c GSEventRunModal
20 UIKitCore 0x1c6288c38 UIApplicationMain
21 Runner 0x1010633bc main + 8 (AppDelegate.swift:8)
22 libdyld.dylib 0x1994ea8e0 start
Crashed: com.twitter.crashlytics.ios.exception
0 Runner 0x10107cc20 CLSProcessRecordAllThreads + 4308732960
1 Runner 0x10107d008 CLSProcessRecordAllThreads + 4308733960
2 Runner 0x10106c874 CLSHandler + 4308666484
3 Runner 0x10107b218 __CLSExceptionRecord_block_invoke + 4308726296
4 libdispatch.dylib 0x1994d97d4 _dispatch_client_callout + 16
5 libdispatch.dylib 0x199487c1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 Runner 0x10107ac84 CLSExceptionRecord + 4308724868
7 Runner 0x10107aab0 CLSExceptionRecordNSException + 4308724400
8 Runner 0x10107a6a4 CLSTerminateHandler() + 4308723364
9 libc++abi.dylib 0x198c68838 std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x198c68434 __cxa_rethrow + 144
11 libobjc.A.dylib 0x198c73bc8 objc_exception_rethrow + 44
12 CoreFoundation 0x199a27020 CFRunLoopRunSpecific + 544
13 GraphicsServices 0x19bc2879c GSEventRunModal + 104
14 UIKitCore 0x1c6288c38 UIApplicationMain + 212
15 Runner 0x1010633bc main + 8 (AppDelegate.swift:8)
16 libdyld.dylib 0x1994ea8e0 start + 4
I am stuck at this and couldn't find any reason or solution.
Thanks in advance

What version of crashlytics are you running? If you are running iOS 13 you should upgrade to 3.14.0. as it will give you better detailed information about the crash.

Related

Crash when set CAMetalLayer.presentsWithTransaction=true in background thread

When set metalLayer.presentsWithTransaction = true, and when I call nextDrawable.present() in bg thread (our rendering thread is not main thread), the app sometimes will crash with:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'
Expected: App will not crash....The rendering should be ok.
Stack trace:
Fatal Exception: NSInternalInconsistencyException
Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1aa30a5ac __exceptionPreprocess
1 libobjc.A.dylib 0x1be38442c objc_exception_throw
2 CoreAutoLayout 0x1be60ad4c -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints]
3 CoreAutoLayout 0x1be60aa20 -[NSISEngine _optimizeWithoutRebuilding]
4 CoreAutoLayout 0x1be60a4f8 -[NSISEngine optimize]
5 CoreAutoLayout 0x1be605b34 -[NSISEngine performPendingChangeNotifications]
6 UIKitCore 0x1ad13eef4 -[UIView(Hierarchy) layoutSubviews]
7 UIKitCore 0x1ad151dd4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
8 QuartzCore 0x1ad65b280 -[CALayer layoutSublayers]
9 QuartzCore 0x1ad65b73c CA::Layer::layout_if_needed(CA::Transaction*)
10 QuartzCore 0x1ad66fb64 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
11 QuartzCore 0x1ad5b7114 CA::Context::commit_transaction(CA::Transaction*, double, double*)
12 QuartzCore 0x1ad5e2418 CA::Transaction::commit()
13 Flutter 0x1032e4778 (Missing)
14 Flutter 0x1035b85ec (Missing)
15 Flutter 0x1035b9094 (Missing)
16 Flutter 0x1035b88b0 (Missing)
17 Flutter 0x1035bedb0 (Missing)
18 Flutter 0x1032ef46c (Missing)
19 Flutter 0x1032f13e0 (Missing)
20 CoreFoundation 0x1aa288050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
21 CoreFoundation 0x1aa287c50 __CFRunLoopDoTimer
22 CoreFoundation 0x1aa2870c4 __CFRunLoopDoTimers
23 CoreFoundation 0x1aa281178 __CFRunLoopRun
24 CoreFoundation 0x1aa2804bc CFRunLoopRunSpecific
25 Flutter 0x1032f12bc (Missing)
26 Flutter 0x1032f0c44 (Missing)
27 libsystem_pthread.dylib 0x1f185aca8 _pthread_start
28 libsystem_pthread.dylib 0x1f1863788 thread_start
Any solution for this?

Metal MTLGetWarningMode + 218 SIGABRT ABORT

I have this error, catched by Crashlytics, Flutter, iOS:
Crashed: io.flutter.1.io
SIGABRT ABORT 0x00000001b624d414
the full error text is:
Crashed: io.flutter.1.io
0 libsystem_kernel.dylib 0x1b624d414 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1d3da8b50 pthread_kill + 272
2 libsystem_c.dylib 0x19172bb74 abort + 104
3 Metal 0x19eb219d4 MTLGetWarningMode + 218
4 IOGPU 0x1c5828490 -[IOGPUMetalCommandBuffer pushDebugGroup:] + 242
5 Metal 0x19eb11990 -[_MTLCommandEncoder initWithCommandBuffer:] + 884
6 IOGPU 0x1c582a140 -[IOGPUMetalCommandEncoder initWithCommandBuffer:] + 56
7 AGXMetalA13 0x1d54462b4 (Missing)
8 AGXMetalA13 0x1d5189770 (Missing)
9 Flutter 0x101c39b00 (Missing)
10 Flutter 0x101c3c9bc (Missing)
11 Flutter 0x101b42d84 (Missing)
12 Flutter 0x101b5596c (Missing)
13 Flutter 0x101b4ec70 (Missing)
14 Flutter 0x101b6c7b8 (Missing)
15 Flutter 0x101b4e830 (Missing)
16 Flutter 0x101b27458 (Missing)
17 Flutter 0x101becedc (Missing)
18 Flutter 0x101dbfc10 (Missing)
19 Flutter 0x101c9dfc4 (Missing)
20 Flutter 0x101c9fe24 (Missing)
21 CoreFoundation 0x188279fa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
22 CoreFoundation 0x188279ba0 __CFRunLoopDoTimer + 1064
23 CoreFoundation 0x188278ffc __CFRunLoopDoTimers + 328
24 CoreFoundation 0x188272ee4 __CFRunLoopRun + 1936
25 CoreFoundation 0x18827221c CFRunLoopRunSpecific + 600
26 Flutter 0x101c9fd00 (Missing)
27 Flutter 0x101c9f704 (Missing)
28 libsystem_pthread.dylib 0x1d3da7cb0 _pthread_start + 320
29 libsystem_pthread.dylib 0x1d3db0778 thread_start + 8
crash_info_entry_0
abort() called
This error occurs, when i use background location updates (package background_location: ^0.4.3), to determine the users location and show the location on a flutter map (flutter_map: ^0.12.0).
HAve anybody an idea, what this error means, and how to resolve/avoid it? Thanks for any help!
Just today I also encountered the same problem as you. At present, it seems that it is caused by the Flutter SDK. It seems that the official has not found a specific solution. You can track the problem from here.
https://github.com/flutter/flutter/issues/76772
Same thing happened to me. Very weird and cannot reproduce or investigate this.
Crashed: io.flutter.1.raster
0 libsystem_kernel.dylib 0x7964 __pthread_kill + 8
1 libsystem_pthread.dylib 0x7378 pthread_kill + 268
2 libsystem_c.dylib 0x1ff50 abort + 164
3 Metal 0xbe390 MTLGetWarningMode + 218
4 IOGPU 0x3ba8 IOGPUResourceGetClientShared + 242
5 Metal 0x146b0 -[_MTLCommandEncoder initWithCommandBuffer:] + 884
6 IOGPU 0x5824 -[IOGPUMetalCommandEncoder initWithCommandBuffer:] + 56
7 AGXMetalA13 0x108604 (Missing)
8 AGXMetalA13 0x36c6c (Missing)
9 Flutter 0x283418 (Missing)
10 Flutter 0x28a508 (Missing)
11 Flutter 0x287028 (Missing)
12 Flutter 0x21fdc8 (Missing)
13 Flutter 0x1877ac (Missing)
14 Flutter 0x187b98 (Missing)
15 Flutter 0x5566c (Missing)
16 Flutter 0x4f9264 (Missing)
17 Flutter 0x47e548 (Missing)
18 Flutter 0x3b46f4 (Missing)
19 Flutter 0x3b4c10 (Missing)
20 Flutter 0x2ec858 (Missing)
21 Flutter 0x3b4308 (Missing)
22 Flutter 0x3b5c40 (Missing)
23 Flutter 0x3b4ec4 (Missing)
24 Flutter 0x3bd304 (Missing)
25 Flutter 0x2eb0c8 (Missing)
26 Flutter 0x2ee694 (Missing)
27 CoreFoundation 0xae268 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
28 CoreFoundation 0x32c40 __CFRunLoopDoTimer + 1076
29 CoreFoundation 0x2d43c __CFRunLoopDoTimers + 328
30 CoreFoundation 0xbc58 __CFRunLoopRun + 1944
31 CoreFoundation 0x1f3b8 CFRunLoopRunSpecific + 600
32 Flutter 0x2ee560 (Missing)
33 Flutter 0x2edd20 (Missing)
34 libsystem_pthread.dylib 0x19a4 _pthread_start + 148
35 libsystem_pthread.dylib 0xea0 thread_start + 8
Also the same is happening to me, IDK exactly what happended. It just crash one time on an iPhone XR
Crashed: io.flutter.1.raster
0 libsystem_kernel.dylib 0x7964 __pthread_kill + 8
1 libsystem_pthread.dylib 0x7378 pthread_kill + 268
2 libsystem_c.dylib 0x1ff50 abort + 164
3 Metal 0xbe390 MTLGetWarningMode + 218
4 IOGPU 0x3ba8 IOGPUResourceGetClientShared + 242
5 Metal 0x146b0 -[_MTLCommandEncoder initWithCommandBuffer:] + 884
6 IOGPU 0x5824 -[IOGPUMetalCommandEncoder initWithCommandBuffer:] + 56
7 AGXMetalA12 0xe24ac (Falta UUID a2eac9f81f443d8aa0602263579fe05e)
8 AGXMetalA12 0x32d5c (Falta UUID a2eac9f81f443d8aa0602263579fe05e)
9 Flutter 0x287de8 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
10 Flutter 0x28e4a8 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
11 Flutter 0x28b584 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
12 Flutter 0x19cfd0 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
13 Flutter 0x1920c4 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
14 Flutter 0x1924b0 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
15 Flutter 0x58c34 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
16 Flutter 0x4f63f0 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
17 Flutter 0x409fc4 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
18 Flutter 0x341d3c (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
19 Flutter 0x349bd4 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
20 Flutter 0x2ee068 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
21 Flutter 0x2f1098 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
22 CoreFoundation 0xae268 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
23 CoreFoundation 0x32c40 __CFRunLoopDoTimer + 1076
24 CoreFoundation 0x2d43c __CFRunLoopDoTimers + 328
25 CoreFoundation 0xbc58 __CFRunLoopRun + 1944
26 CoreFoundation 0x1f3b8 CFRunLoopRunSpecific + 600
27 Flutter 0x2f0f74 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
28 Flutter 0x2f0788 (Falta UUID e01ae2d7b4293d2bad99555f1db36746)
29 libsystem_pthread.dylib 0x19a4 _pthread_start + 148
30 libsystem_pthread.dylib 0xea0 thread_start + 8

Flutter IOS Firebase Crashlytics Fatal Exception: NSInternalInconsistencyException

I am not sure what causes this error? I've been trying to work it out for days. Any suggestions?
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x186a7186c __exceptionPreprocess
1 libobjc.A.dylib 0x19ba8dc50 objc_exception_throw
2 CoreFoundation 0x186977000 -[CFPrefsSearchListSource addManagedSourceForIdentifier:user:]
3 Foundation 0x187d0b91c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 Flutter 0x1051f8868 (Missing)
5 Flutter 0x1051f560c (Missing)
6 Flutter 0x104ef2028 (Missing)
7 Flutter 0x10520e540 (Missing)
8 Flutter 0x1051aa7a8 (Missing)
9 Flutter 0x1051ac608 (Missing)
10 CoreFoundation 0x1869edfa0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
11 CoreFoundation 0x1869edba0 __CFRunLoopDoTimer
12 CoreFoundation 0x1869ecffc __CFRunLoopDoTimers
13 CoreFoundation 0x1869e6ee4 __CFRunLoopRun
14 CoreFoundation 0x1869e621c CFRunLoopRunSpecific
15 GraphicsServices 0x19e5b3784 GSEventRunModal
16 UIKitCore 0x189426ee8 -[UIApplication _run]
17 UIKitCore 0x18942c75c UIApplicationMain
18 MYAPP 0x1005b1b0c main + 7 (AppDelegate.swift:7)
19 libdyld.dylib 0x1866a66b0 start

OpenGL rendering crash during Flutter app startup on IOS

I have an app developed in Flutter, I track its crashes by Firebase Crashlytics.
According to it in 99% of the time it is crash free, but during 1% of the sessions on IOS I have a strange crash at startup of the app.
OpenGL rendering while app in background state
keyboard_arrow_up
Crashed: io.flutter.1.gpu
0 libGPUSupportMercury.dylib 0x2374b2fe4 gpus_ReturnNotPermittedKillClient + 12
1 AGXGLDriver 0x23b9fcec8 gldUpdateDispatch + 7184
2 libGPUSupportMercury.dylib 0x2374b3fac gpusSubmitDataBuffers + 176
3 AGXGLDriver 0x23b9fe3f4 gldUpdateDispatch + 12604
4 GLEngine 0x23cb95234 gliPresentViewES_Exec + 184
5 OpenGLES 0x21e8ddaa4 -[EAGLContext presentRenderbuffer:] + 80
6 Flutter 0x100a54e84 (Missing)
7 Flutter 0x100da8e18 (Missing)
8 Flutter 0x100aad2d8 (Missing)
9 Flutter 0x100a9dcf0 (Missing)
10 Flutter 0x100a9e15c (Missing)
11 Flutter 0x100a9e868 (Missing)
12 Flutter 0x100a9dfe4 (Missing)
13 Flutter 0x100aa2d94 (Missing)
14 Flutter 0x100a63098 (Missing)
15 Flutter 0x100a6448c (Missing)
16 CoreFoundation 0x21b66a8f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
17 CoreFoundation 0x21b66a624 __CFRunLoopDoTimer + 864
18 CoreFoundation 0x21b669e58 __CFRunLoopDoTimers + 248
19 CoreFoundation 0x21b664da8 __CFRunLoopRun + 1844
20 CoreFoundation 0x21b664354 CFRunLoopRunSpecific + 436
21 Flutter 0x100a64318 (Missing)
22 Flutter 0x100a63be8 (Missing)
23 libsystem_pthread.dylib 0x21b2f82c0 _pthread_body + 128
24 libsystem_pthread.dylib 0x21b2f8220 _pthread_start + 44
25 libsystem_pthread.dylib 0x21b2fbcdc thread_start + 4
Do you have similar experiences? Is there any way to fix it?
Thanks a lot!

Stacktrace is no longer symbolicated

I do my own error handling by catching any exceptions and logging them manually. I use NSSetUncaughtExceptionHandler(&myExceptionHandler); and log the stack trace using [NSException callStackSymbols]. Up until recently my logs contained the symbolicated stack trace. Now they don't and there weren't any code changes related to the logging. This is occurring on all devices and versions of iOS. I am able to manually symbolicate my logs but it is quite cumbersome. Any insight would be greatly appreciated.
Previously my logs looked like:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a -[MyViewController(Images) didReceiveImage:context:etag:expires:] + 42
2 MYAPP 0x0004fb26 -[MyImageTask didReceiveImage:] + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
After my last release they look like:
0 libobjc.A.dylib 0x352925b0 objc_msgSend + 16
1 MYAPP 0x0006573a - MYAPP + 42
2 MYAPP 0x0004fb26 - MYAPP + 98
3 Foundation 0x361ac8e8 __NSThreadPerformPerform
4 CoreFoundation 0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5 CoreFoundation 0x3b37cee4 __CFRunLoopDoSources0
6 CoreFoundation 0x3b37bcb2 __CFRunLoopRun
7 CoreFoundation 0x3b2eeeb8 CFRunLoopRunSpecific
8 CoreFoundation 0x3b2eed44 CFRunLoopRunInMode
9 GraphicsServices 0x396bc2e6 GSEventRunModal
10 UIKit 0x3452e2f4 UIApplicationMain
11 MYAPP 0x0004934a main + 70
12 MYAPP 0x000492fc start + 36
Looks like Apple now performs a kind of repackaging and eventually stripping debug info.

Resources