问题描述:

So I've got my awesome app, that runs perfectly on simulator or while the device is plugged in.

And then if I create an IPA and deploy it on my device, or use TestFlight, or even submit to the App Store. The app will crash most of the time when I try launching it.

The crash reports even not symbolized don't give me any information.

I've used TestFlight so that it could maybe help me figure out where the app crashes, but the app Crashes before TestFlight launches.

Here is some of my code (main.m):

#import <UIKit/UIKit.h>

#import "version3contentAppDelegate.h"

int main(int argc, char *argv[]) {

@autoreleasepool {

return UIApplicationMain(argc, argv, nil, NSStringFromClass([version3contentAppDelegate class]));

}

}

and beginning of version3contentAppDelegate.m:

#import "TestFlight.h"

#import "version3contentAppDelegate.h"

#import "RootTableViewController.h"

#import "AppsFeedTableViewController.h"

#import "AboutShmoopModalViewController.h"

@implementation version3contentAppDelegate

@synthesize window, shmoopCoreData, tabBarController;

#pragma mark -

#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

NSLog(@"applicationDidFinishLaunching");

[TestFlight takeOff:@"3f3618576288d96d598646d060a4f26a_NzUyMjEyMDEyLTAzLTI2IDE3OjIxOjQzLjgyNzQwNg"];

...

As you can see the TestFlight code is at the beginning of the didFinishLaunching. This means that if it would crash after that, I would have a crash report on TestFlight, which I don't have.

Would anyone have any idea why this is happening ?

The project has been originally developed on an old xcode, for old iphone, currently its an xcode 3 project. But I'm programming it on XCode 4.3 with iOS 5.1 on devices.

网友答案:

As per your request, here is my comment:

It does get into didFinishLaunching if it shows the splash screen. I noticed you aren't using ARC, though. Could it be that you are overreleasing something? Refactor your project and see if that helps

网友答案:

If it crashes on your device then you will have a crash log to look at.

Secondly, in my experience the main cause of crashes in application: didFinishLaunchingWithOptions: is due to loading resources that take too long to load.

iOS has a watchdog timer which watches apps and kills them if they take too long to do certain things. Loading, unloading etc. Usually it's a couple of seconds and if they take longer than that the timer kills them, assuming they are hung.

This timer is disabled for debug reasons in the simulator which is why these crashes only appear during actual device testing.

Once you have a crash log from your local device, check the code given, if it is 0x8badf00d then it is the watch dog timer killing your app. Notice the error code 8-bad-food :-)

Then you need to look at your code and move as much as possible onto a background thread so that the didFinishLaunchingWithOptions: method can finish asap.

网友答案:

It could be a crash in TestFlight's launch itself - I just spent quite some time tracking down a very similar issue, where an AdHoc testing deployment was randomly, sometimes crashing on open, and it was specifically the [TestFlight takeOff:...] line that the backtrace showed it crashing on.

Get the crash logs off of the device (In all such cases where it has crashed after being at the splash screen I have had crash logs), and try using symbolicatecrash to translate the dump - In my case, it didn't translate anything except the applicationDidFinishLaunching:withOptions line that called into testflight.

网友答案:

Its an problem with Xcode. If you are not using auto layout and size class, then delete launch xib file. Crash will be resolved.

相关阅读:
Top