Search
Goodies

Social Networks
Designs I Like
« BREAKING: uP@ssw0rdz! Version 2.1 ready for sale | Main | MockApp - a nice UI prototyping tool »
Friday
Mar052010

App startup crash: finding the root cause

Sadly my latest attempt to submit my application update 2.1 was rejected by Apple because of a crash at application launch time on an iPhone 3GS at OS version 3.1.3 and iPod touch at OS version 3.1.3.

Hello Jean-Francois,
At this time, uP@ssw0rdz! Password Manager & Generator cannot be posted to the App Store because it is failing to launch on iPhone 3GS running iPhone OS 3.1.3 and iPod touch running iPhone OS 3.1.3 and Mac OS X 10.6.2. The application opens, displays a launch image, and then quits unexpectedly. 
In order for your application to be reconsidered for the App Store, please resolve this issue and upload your new binary to iTunes Connect.
For more information regarding launch failure when the application is not run from Xcode and is installed on a device:
http://developer.apple.com/iphone/library/qa/qa2009/qa1592.html
For more information regarding signing and missing entitlement:
http://developer.apple.com/iphone/library/technotes/tn2009/tn2242.html

I have no idea what could be the problem as I have a version of my application in AdHoc distribution format which works on my iPhone 3GS at same level of OS... Well, this is what I thought.

The investigation

First, article QA1592 is about crashes occurring with the application running outside of Xcode. This could happen if the application takes too much time to initialize and the watchdog on the physical device kills the application as it think it is having problem. In my case, this is not what happens. Tests shows that the application starts and after less than a second, it crashes. In the case of the watchdog killing the application, it take more time to do so (near 10 seconds). Seems a different cause to me.

Testing an AdHoc build on my iPod touch 1gen at 3.1.2 gives the exact problem: the application starts then eventually crashes.... Mmmm. In the Organizer, here is the crash log:


Referring to article QA1592 and the crash log, the exception codes are 0x00000000. So, I have to look somewhere else.

Well, does it even works running from Xcode ? Yep. Running from Xcode on the device, the installation and initial setup of the application is just fine. So, it is a problem with AdHoc or Distribution builds...

On technical article TN2242

The first part is about having Bundle Identifier and App ID that should match otherwise the application won't launch  on the provisioned device. A look at the Xcode config reveals the following:


All seems fine here too.

Again in TN2242, Adhoc misconfiguration could be the cause. Looking at the settings, the Entitlement.plist is fine as the check box is not checked as required.


There could be a problem with a missing or incorrect UDID. Again, no problem on that side too as my 3GS is correctly defined in the provisioning profile I'm using (since I'm using a 3GS, I had to update my provisioning profile to include it for testing purposes).

Finally, again according to TN2242, a certificate issue could be the root of the cause. A look at my Keychain Access utility, we see that all certificates are still valid. So, the application signing process should be ok too. Anyway, in the Xcode compile result windows, there is no error whatsoever.

How things is looking in the Xcode Organizer (this is a place where we can have access to all provisioning profiles on a dev machine):


The profile called "My Provisioning Profile" is the original one that I created once I enrolled in the iPhone dev program last year and is still fine. There is also another profile called "uPasswordz Beta" that is more recent and include my iPhone. So this is the one I should use when building for the AdHoc distribution for the iPhone. 

In Xcode, the setting is as shown here:


Building again an Adhoc version and installing on my iPod touch, the application works as expected. On the 3GS, no luck, still crashes. Another look at the crash logs on the device via Xcode Organizer shows again this:

What is this EXC_CRASH (SIGABRT) ? Searching the Internet, we see lots of guy having this issue at some point:

http://forums.macrumors.com/showthread.php?t=691504
http://www.iphonedevsdk.com/forum/iphone-sdk-development/41350-app-crashes-when-launched-apple.html

The only thing that I need to do is symbolicate the crash log and see what's there. Here is a quick reference: http://junxian-huang.blogspot.com/2010/02/how-to-read-crash-log-file-for-iphone.html

At the command prompt (in Terminal):
./symbolicatecrash.pl /Users/jf/Desktop/uPasswords_2010-03-05-073853_iPhoneJF.crash /Users/jf/Desktop/uPasswords.app.dSYM

The start of the output is telling me something:

## Warning: Unable to symbolicate from required binary: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
## Warning: Unable to symbolicate from required binary: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/usr/lib/libstdc++.6.dylib
## Warning: Unable to symbolicate from required binary: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/PrivateFrameworks/WebCore.framework/WebCore
## Warning: Unable to symbolicate from required binary: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/Frameworks/Foundation.framework/Foundation
...

Why the 3.1.3 libs are referred but I was building my app against SDK 3.1.2 ??? I forgot something very important, in Xcode (that I upgraded to support iPhone OS 3.1.3), the Base SDK was still referring to 3.1.2... A Clean All Targets, followed by a build against SDK 3.1.3 fixed the problem !


Time to re-submit my application to Apple for approval. 

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>