由于未捕获的异常终止应用程序' NSInternalInconsistencyException',原因:'访问_cachedSystemAnimationFence需要主线程

时间:2017-02-16 06:38:39

标签: ios multithreading xamarin xamarin.ios

我正在使用Xamarin.IOS进行开发。 我从用户那里收到了很多这样的崩溃报告。

崩溃报告如下所示:

    Incident Identifier: 21D06ED3-DE8E-4872-B75F-19D5B350E406
    CrashReporter Key:   07432D3F-8FFD-427B-A2C6-6B6E77AF5223
    Hardware Model:      iPhone7,2
    Process:         ****
    Path:            ****
    Identifier:      ****
    Version:         ****
    Code Type:       ARM-64
    Parent Process:  ??? [1]

    Date/Time:       2017-02-08T14:54:58Z
    Launch Time:     2017-02-08T14:54:50Z
    OS Version:      iPhone OS 10.2.1 (14D27)
    Report Version:  104

    Exception Type:  SIGABRT
    Exception Codes: #0 at 0x18d3d7014
    Crashed Thread:  13

    Application Specific Information:
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'

    Last Exception Backtrace:
    0   CoreFoundation                       0x000000018e4091b8 0x18e2d9000 + 1245624
    1   libobjc.A.dylib                      0x000000018ce4055c 0x18ce38000 + 34140
    2   CoreFoundation                       0x000000018e40908c 0x18e2d9000 + 1245324
    3   Foundation                           0x000000018eec102c 0x18ee13000 + 712748
    4   UIKit                                0x000000019453f690 0x1942af000 + 2688656
    5   UIKit                                0x0000000194596d70 0x1942af000 + 3046768
    6   UIKit                                0x0000000194379e7c 0x1942af000 + 831100
    7   UIKit                                0x00000001942c5448 0x1942af000 + 91208
    8   UIKit                                0x0000000194334308 0x1942af000 + 545544
    9   UIKit                                0x00000001943ba318 0x1942af000 + 1094424
    10  UIKit                                0x0000000194629488 0x1942af000 + 3646600
    11  UIKit                                0x00000001a25d47e0 0x1a2584000 + 329696
    12  UIKit                                0x000000019462adec 0x1942af000 + 3653100
    13  UIKit                                0x000000019462d62c 0x1942af000 + 3663404
    14  UIKit                                0x00000001942cc7dc 0x1942af000 + 120796
    15  UIKit                                0x000000019462d59c 0x1942af000 + 3663260
    16  UIKit                                0x000000019462d920 0x1942af000 + 3664160
    17  UIKit                                0x00000001943b1154 0x1942af000 + 1057108
    18  UIKit                                0x00000001a25d40dc 0x1a2584000 + 327900
...
Thread 13 Crashed:
0   libsystem_kernel.dylib               0x000000018d3d7014 0x18d3b8000 + 126996
1   libsystem_c.dylib                    0x000000018d34b400 0x18d2e8000 + 406528
2   GIVCONVEYiOS                         0x000000010019fd90 0x1000f8000 + 687504
3   GIVCONVEYiOS                         0x000000010010606c 0x1000f8000 + 57452
4   CoreFoundation                       0x000000018e409538 0x18e2d9000 + 1246520
5   libobjc.A.dylib                      0x000000018ce40838 0x18ce38000 + 34872
6   GIVCONVEYiOS                         0x000000010018dadc 0x1000f8000 + 613084
7   libc++abi.dylib                      0x000000018ce2f66c 0x18ce14000 + 112236
8   libc++abi.dylib                      0x000000018ce2ef84 0x18ce14000 + 110468
9   libobjc.A.dylib                      0x000000018ce40690 0x18ce38000 + 34448
10  CoreFoundation                       0x000000018e40908c 0x18e2d9000 + 1245324
11  Foundation                           0x000000018eec102c 0x18ee13000 + 712748
12  UIKit                                0x000000019453f690 0x1942af000 + 2688656
13  UIKit                                0x0000000194596d70 0x1942af000 + 3046768
14  UIKit                                0x0000000194379e7c 0x1942af000 + 831100
15  UIKit                                0x00000001942c5448 0x1942af000 + 91208
16  UIKit                                0x0000000194334308 0x1942af000 + 545544
17  UIKit                                0x00000001943ba318 0x1942af000 + 1094424
18  UIKit                                0x0000000194629488 0x1942af000 + 3646600
19  UIKit                                0x00000001a25d47e0 0x1a2584000 + 329696
20  UIKit                                0x000000019462adec 0x1942af000 + 3653100
21  UIKit                                0x000000019462d62c 0x1942af000 + 3663404
22  UIKit                                0x00000001942cc7dc 0x1942af000 + 120796
23  UIKit                                0x000000019462d59c 0x1942af000 + 3663260
24  UIKit                                0x000000019462d920 0x1942af000 + 3664160
...

由于它没有呈现堆栈跟踪,因此很难缩小可疑代码区域。从错误消息中,它表明线程13崩溃,因为它更新了UI。

我知道线程13是后台线程。 问:我如何缩小这个问题?或者,我们是否可以通过在每次更新UI之前检测它是否在Mainthread上来追踪此问题?

我试图象征并获得更多信息。

尝试Symbolicate并获取更多信息。线程15崩溃:

0   libsystem_kernel.dylib               0x0000000187543014 __pthread_kill + 8
1   libsystem_c.dylib                    0x00000001874b7400 abort + 140
2   GIVCONVEYiOS                         0x000000010013bd90 0x100094000 + 687504
3   GIVCONVEYiOS                         0x00000001000a206c 0x100094000 + 57452
4   CoreFoundation                       0x0000000188575538 __handleUncaughtException + 644
5   libobjc.A.dylib                      0x0000000186fac838 _objc_terminate() + 112
6   GIVCONVEYiOS                         0x0000000100129adc 0x100094000 + 613084
7   libc++abi.dylib                      0x0000000186f9b66c std::__terminate(void (*)()) + 16
8   libc++abi.dylib                      0x0000000186f9af84 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9   libobjc.A.dylib                      0x0000000186fac690 _objc_exception_destructor(void*) + 0
10  CoreFoundation                       0x000000018857508c +[NSException raise:format:arguments:] + 104
11  Foundation                           0x000000018902d02c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
12  UIKit                                0x000000018e6ab690 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
13  UIKit                                0x000000018e702d70 +[UIWindow _synchronizeDrawingWithPreCommitHandler:] + 68
14  UIKit                                0x000000018e4e5e7c -[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] + 700
15  UIKit                                0x000000018e431448 -[UIApplication _updateCurrentStatusBarViewControllerAppearance] + 436
16  UIKit                                0x000000018e4a0308 -[UIViewController setNeedsStatusBarAppearanceUpdate] + 204
17  UIKit                                0x000000018e526318 -[UIViewController _setPresentedStatusBarViewController:] + 96
18  UIKit                                0x000000018e795488 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1512
19  UIKit                                0x000000019c7407e0 -[UIViewControllerAccessibility _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 256
20  UIKit                                0x000000018e796dec -[UIViewController _presentViewController:withAnimationController:completion:] + 4524
21  UIKit                                0x000000018e79962c __62-[UIViewController presentViewController:animated:completion:]_block_invoke_2 + 68
22  UIKit                                0x000000018e4387dc +[UIView(Animation) performWithoutAnimation:] + 104
23  UIKit                                0x000000018e79959c __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 312
24  UIKit                                0x000000018e799920 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
25  UIKit                                0x000000018e51d154 -[UIViewController presentViewController:animated:completion:] + 184
26  UIKit                                0x000000019c7400dc -[UIViewControllerAccessibility presentViewController:animated:completion:] + 204
27  GIVCONVEYiOS                         0x00000001003a59b0 0x100094000 + 3217840
28  GIVCONVEYiOS                         0x0000000100341b08 0x100094000 + 2808584
29  GIVCONVEYiOS                         0x0000000100fce0a0 0x100094000 + 15966368
30  GIVCONVEYiOS                         0x0000000100fceee4 0x100094000 + 15970020
31  GIVCONVEYiOS                         0x0000000100fd48dc 0x100094000 + 15993052

如何使用以下信息行找到代码:27 GIVCONVEYiOS 0x00000001003a59b0 0x100094000 + 3217840

0 个答案:

没有答案