iOS crash libobjc.A.dylib objc_msgSend

╄→гoц情女王★ 提交于 2021-02-18 10:44:33

问题


I am getting the crash shown below in Crashlytics.

I am unable to understand where this is coming form within the app. Unfortunately I have never been able to generate this crash myself, but it is occurring in the wild.

There is only one reference to the app name, and there is nothing that leads to show where in the app this is coming from.

Is the fact that there is no data as to where in the app this occurs, an indication of an issue occurring during didFinishLaunchingWithOptionsand thus not actually getting far enough to show any further detail? Or is there some other reason that the log is lacking in data to show where the issue is?

Could anyone advise how I may be able to track this down?

    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

I am adding the following in relation the comments placed on this thread. This code was the main UI related change, other than usual label setting etc, which I can't see an issue with.

The code below was added to the AppDelegate.m, DidFinishLaunchingWithOptions.

I am wondering, as the crash is not something I have been able to re-produce, and whilst happening daily is only in a handful of cases, if it could be a timing issue, and the UI not being available to receive the messages.

I welcome any thoughts, and if you agree, if I should instead move the code to the ViewDidLoad in the ViewController instead.

[[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];

回答1:


After much searching in the code, I stumbled across another post on here objc_msgSend [__NSArrayM dealloc] crash report sometimes from Crashlytics.

It seems that Crashlytics had a bug in 3.0.9, and was the cause of this issue.

Updated the SDK and all now okay.




回答2:


It's a crash caused by a System library. There isn't much you can do here



来源:https://stackoverflow.com/questions/31357028/ios-crash-libobjc-a-dylib-objc-msgsend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!