views:

298

answers:

1

Hi, I just submitted this to Apple Support, but I'm wondering if anyone here has encountered something similar.

SUMMARY: my iphone app crashes when downloaded from the iTunes app store or from an ad-hoc distribution, but doesn't "crash" when run in debug mode on the simulator or on my iPod

DETAILS: The app contains a rather large sqlite database file (~180 meg uncompressed, 56 meg compressed). This may be relevant.

When launched, the application should copy the database (if necessary). After this, the user should be presented with a table-view containing approximately 6,000 rows. The information presented within these rows is derived from reading a table within the aforementioned database.

This all works properly when I run the application in the iPhone simulator and also when I run the application in debug mode on my iPod.

The app was approved by Apple. However, when users began to download the app through iTunes, I began receiving emails saying that the UITableView was not populated with any information. To investigate, I downloaded a copy of the app from the app store and I saw a similar result (i.e., UITableView is displayed, but the rows are empty).

I believe I am able to reproduce the problem using an ad-hoc distribution of my app.

The ad-hoc distribution behaves similarly (i.e. shows no rows in the UITableView) to the app-store download. Specifically, I have done the following multiple times (I delete and reinstall the application each time).

  1. add my ad-hoc provisioning certificate to iTunes
  2. add my ad-hoc app build to iTunes
  3. sync my iPod Touch with iTunes
  4. start my ad-hoc app
  5. app seems to always crash upon the first startup (i.e., the splash screen shows for a second and then I see the home screen of my iPod Touch)
  6. second and subsequent start-ups of the ad-hoc app do not crash, but the UITableView is empty.
  7. None of this happens when I run the app on the simulator or when I deploy in development/debug mode on the same iPod.

I have tried to examine crash logs associated with the initial crashing of the app (see step 5 above), but no crash log is created at that point in time. HOWEVER, a crash log is created when I sync iTunes with my iPod Touch, but it might as well be written in Polish.

So, it appears as though the app-store reviewers who approved my app only examined the behavior of the application using the simulator and/or in development/debug mode. It's possible that the issue is related to the large size of the database file, but this is complete speculation on my part. To the best of my understanding there should not be a limit on app-size or database size near 180 meg. This also wouldn't necessarily explain why the app works in debug/development mode.

Has anyone seen anything similar?

A: 

I think I figured this out (haven't tested it yet)...

Turns out the entire crash log isn't written in polish.

There's a part that says that the "application failed to launch in time"

I suspect that my database is too large to be copied during launch of the application.

to quote apple: **iPhone OS uses a watchdog timer when applications are launched. If an application takes too long to complete its initial startup, the operating system terminates the application. Applications terminated for this reason will have the exception code 0x8badf00d and related information noted in the associated crash report:

When Xcode launches an application, the watchdog timer is disabled to compensate for additional overhead that may be incurred when Xcode attaches the debugger. As a result, your application's long startup may initially escape your attention if you are exclusively testing by running from Xcode.**

Yeah, if you need to do an op that large, you shouldn't be doing it applicationDidFinishLaunching. You need to let the app start, then you can handle this, perhaps with a progress display if necessary.
Hunter