简体   繁体   中英

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. There are no issues with other models; on iPhone 5, 5c, iPod it is working fine.

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. Please tell me whether I need to modify anything in build settings or build phases or 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.

- (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. Some frameworks like CoreData inserts exit statements in the code. Try searching for exit(-1) in your code. You can also

  1. Put NSLog in various methods of AppDelegate and see where it crashes.
  2. You can use a try-catch block in main method.

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

in your main method in 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. I'm sure it's temporary but commenting out

Taplytics.startTaplyticsAPIKey("XXXXX")

in App Delegate fixed my issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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