iOS 崩溃 libobjc.A.dylib objc_msgSend

iOS crash libobjc.A.dylib objc_msgSend

我在 Crashlytics 中遇到如下所示的崩溃。

我无法理解这是应用程序中的什么形式。不幸的是,我自己从未能够生成此崩溃,但它正在发生。

只有一个对应用程序名称的引用,没有任何内容表明它来自应用程序中的哪个位置。

事实上没有关于应用程序中发生这种情况的数据,这是否表明在 didFinishLaunchingWithOptions 期间发生了问题,因此实际上还不足以显示任何进一步的细节?或者是否有其他原因导致日志缺少数据来显示问题出在哪里?

谁能告诉我如何才能追踪到它?

    Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x0000000195de3bd0 objc_msgSend + 16
1  CoreFoundation                 0x0000000183fd9458 CFRelease + 524
2  CoreFoundation                 0x0000000183fe5a18 -[__NSArrayM dealloc] + 152
3  libobjc.A.dylib                0x0000000195de9724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
4  CoreFoundation                 0x0000000183fdd074 _CFAutoreleasePoolPop + 28
5  Foundation                     0x0000000184f0e588 -[NSAutoreleasePool release] + 148
6  UIKit                          0x0000000188be03f4 -[UIApplication _run] + 588
7  UIKit                          0x0000000188bdaf40 UIApplicationMain + 1488
8  _THE_APP_NAME_                 0x0000000100031e20 main (main.m:16)
9  libdyld.dylib                  0x000000019647aa08 start + 4

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000f5b2beb8

我添加了以下与此线程上的评论相关的内容。此代码是与 UI 相关的主要更改,而不是通常的标签设置等,我看不出有什么问题。

下面的代码已添加到 AppDelegate.m、DidFinishLaunchingWithOptions。

我想知道,因为崩溃不是我能够重现的,虽然每天发生的情况只是少数情况,如果它可能是时间问题,并且 UI 无法接收消息。

我欢迎任何想法,如果你同意,我是否应该将代码移至 ViewController 中的 ViewDidLoad。

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                               [UIColor lightGrayColor], NSForegroundColorAttributeName,
                                                               [UIFont fontWithName:@"Helvetica Neue" size:16],
                                                               NSFontAttributeName, nil] forState:UIControlStateNormal];
            [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                               [UIColor darkGrayColor], NSForegroundColorAttributeName,
                                                               [UIFont fontWithName:@"Helvetica Neue" size:16],
                                                               NSFontAttributeName,
                                                               nil] forState:UIControlStateSelected];

    [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:0.44 green:0.99 blue:0.45 alpha:1]];

    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.44 green:0.99 blue:0.45 alpha:1]];

    [[UINavigationBar appearance] setTintColor:[UIColor darkGrayColor]];

    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor darkGrayColor], NSFontAttributeName : [UIFont fontWithName:@"Helvetica Neue" size:22]}];

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

这是系统库导致的崩溃。您在这里无能为力

在代码中进行了大量搜索后,我在这里 偶然发现了另一个 post。

似乎 Crashlytics 在 3.0.9 中有一个错误,并且是导致此问题的原因。

更新了SDK,现在一切正常。