简体   繁体   English

iOS应用仅在iPhone 5s上崩溃

[英]iOS app crashing only on iPhone 5s

I have a very strange issue. 我有一个很奇怪的问题。 Please help out. 请帮忙。 My app is crashing only on the iPhone 5s. 我的应用仅在iPhone 5s上崩溃。 There are no issues with other models; 其他型号没有问题; on iPhone 5, 5c, iPod it is working fine. 在iPhone 5、5c,iPod上运行正常。

The problem is when I click on the app icon, the splash screen is appearing and crashing. 问题是当我单击应用程序图标时,启动屏幕出现并崩溃。 It is not showing the root view. 它没有显示根视图。 I have added splash images in the proper size. 我添加了适当大小的启动图像。 My didFinishLaunchingWithOptions function is below. 我的didFinishLaunchingWithOptions函数如下。 Please tell me whether I need to modify anything in build settings or build phases or info.plist. 请告诉我是否需要在构建设置或构建阶段或info.plist中进行任何修改。 I am using Crashlytics for crash logs and there no crash logs coming but I am getting crash logs when it crashed in other devices inside the application. 我正在使用Crashlytics崩溃日志,并且没有崩溃日志,但是当它在应用程序内的其他设备中崩溃时,我正在获取崩溃日志。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     ViewController *rootController=[[ViewController alloc] initWithNibName:@"ViewController " bundle:nil];
    _navigationController=[[UINavigationController alloc] initWithRootViewController:rootController];

    self.window.rootviewcontroller = _navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}

It would be difficult to find an issue without any crash logs or errors. 如果没有任何崩溃日志或错误,将很难找到问题。 I would like to check if the application really crashed or was it any exit(-1) statement which caused the application to exit. 我想检查应用程序是否真的崩溃了,或者是导致应用程序退出的任何exit(-1)语句。 Some frameworks like CoreData inserts exit statements in the code. 诸如CoreData之类的某些框架会在代码中插入退出语句。 Try searching for exit(-1) in your code. 尝试在代码中搜索exit(-1)。 You can also 你也可以

  1. Put NSLog in various methods of AppDelegate and see where it crashes. 将NSLog放入AppDelegate的各种方法中,然后查看崩溃的位置。
  2. You can use a try-catch block in main method. 您可以在main方法中使用try-catch块。

@try{..} @catch(NSException *ex){NSLog(@"%@",ex.debugDescription);}

in your main method in main.m. 在main.m中的主要方法中。 This should help you in finding if there is any exception at all. 这应该可以帮助您查找是否有任何异常。

I know this is really old but today I was running into an issue with crashes on all devices and simulators older than iPhone 6 and it turned out to be some bug with Taplytics. 我知道这确实很老,但是今天我遇到了一个问题,所有早于iPhone 6的设备和模拟器都崩溃了,事实证明这是Taplytics的错误。 I'm sure it's temporary but commenting out 我敢肯定这是暂时的,但要注释掉

Taplytics.startTaplyticsAPIKey("XXXXX")

in App Delegate fixed my issue 在App Delegate中解决了我的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM