views:

332

answers:

6

I developed an app with Xcode 3.2.3 and iphone SDK 4.0, it works fine on both iPhone 3GS and 3G if I run it directly with xcode.

However, if I download and install the app from appstore, it crashes at the launch screen for iPhone 3G and iPod Touch. (But works on 3GS with OS 3.1.3 or iOS 4.0)

The device log shows the following:

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)

Exception Codes: 0x00000001, 0x00000000

Crashed Thread:  0


Thread 0 Crashed:
0   Dove                            0x000762aa +[TTNavigator navigator] (TTNavigator.m:59)

1   Dove                            0x000035ce -[Around01AppDelegate applicationDidFinishLaunching:] (Around01AppDelegate.m:85)

2   UIKit                           0x00004e88 -[UIApplication _performInitializationWithURL:sourceBundleID:] + 540

3   UIKit                           0x00004a60 -[UIApplication _runWithURL:sourceBundleID:] + 576

4   UIKit                           0x00055df8 -[UIApplication handleEvent:withNewEvent:] + 1516

5   UIKit                           0x00055634 -[UIApplication sendEvent:] + 60

6   UIKit                           0x0005508c _UIApplicationHandleEvent + 4528

7   GraphicsServices                0x00005988 PurpleEventCallback + 1044

8   CoreFoundation                  0x00057524 CFRunLoopRunSpecific + 2296

9   CoreFoundation                  0x00056c18 CFRunLoopRunInMode + 44

10  UIKit                           0x00003c00 -[UIApplication _run] + 512

11  UIKit                           0x00002228 UIApplicationMain + 960

12  Dove                            0x00003086 main (main.m:26)

13  Dove                            0x00002ec8 start + 44

Anyone knows how to fix this? Thanks!

+2  A: 

You have the wrong architecture setting in your Release configuration. If you want to deploy on a 3G and 2008 iPod touch, you must create instructions for arm6 and arm7. You are probably creating an optimized arm7 binary only. Add the arm6 architecture to your Release configuration and try again.

Jason Coco
Hi Jason, thanks for the help! Here's my project setting: Architectures: Standard(armv6 armv7), Base SDK: iPhone Device 4.0, Build active Architecture Only:(Checked), Valid Architectures: armv6 armv7. Are these the correct settings I should make? The app works fine on 3G when I run it with xCode. Thanks!
noear
I figured it out by referring to info on this page: http://useyourloaf.com/blog/2010/4/21/xcode-build-active-architecture-only.htmlWill submit a new binary later on and see how it goes. Thanks!
noear
@noear: Oh, good, I'm glad you figured it out. You should answer your question with that link as the actual answer and accept it, that way people searching for a similar thing can quickly find the solution :)
Jason Coco
+2  A: 

I figured it out by referring to info on this page: http://useyourloaf.com/blog/2010/4/21/xcode-build-active-architecture-only.html

If you are using any third-party libraries, should recompile all of them using the same project settings as you used on your own project.

In my case, Base SDK: iOS 4.0, Deployment Target: 3.0, and make sure you uncheck "Build Active Architecture Only"

noear
+1 for pointing out that third-party libraries can cause this to happen.
Jesse Rusak
A: 

Hey noear, I'm having the same issue but I still can't seem to figure this out, can you please help, I must be missing something...

My app works on iPhone 3GS and 4 with 4.0/4.01 installed, however it still crashes at launch on iPhone 3G that has 4.0/4.01 installed. It works fine on Debug Mode

My settings are pretty much the same you described above.

Configuration: Distribution Architecture: Standard (armv6 armv7) Base SDK: iPhone Device 4.0 Build Active Architecture Only: Unchecked Valid Architectures: armv6 armv7 Deployment Target: iPhone OS 3.0

I use Facebook-three, and I recompiled the whole project with the same settings

any idea? Thank you very much!

KTS
so found out that it has something to do with the external library. As soon as I removed all dependencies, it works. I just can't figure out why it doesn't work with it... I compile all facebook-three libraries from my project, therefore the same settings (I assume)
KTS
A: 

Hi KTS,I get the same problem as you. Have you sorted this out? please help!

MaS
A: 

The start-up crash is a result of the wrong architecture for the dependencies and your project. I had a similar issue with my project. My project was running fine on Debug iPhone 3G, and crashing Release iPhone 3G. However, it ran fine on iPad and iPhone 4 in Debug/Release.

I had a library that I was building with Debug (Standard armv6, armv7), and the Release (Optimized armv7). The main project was building with Standard (armv6, armv7) for Debug/Release. This architecture mismatch caused the crash in Release on iPhone 3G. The reason I had this crash is that iPhone 3G must use armv6, but iPhone 4 and iPad can use armv7.

run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
Program received signal:  “EXC_BAD_ACCESS”.
warning: check_safe_call: could not restore current frame

warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
warning: Unable to restore previously selected frame.
(gdb) 

To fix the issue change the iPhone library Target's "Architectures" to use Standard (armv6, armv7) for "All Configurations".

Paul Solt
A: 

Hey, you've mentioned using Facebook three20 library. We had exactly the same problem - application crashing with EXC_BAD_ACCESS only in appstore distribution | release configuration, ONLY on iPhone 3G / iPod touch 2G, but working perfectly on iPhone 3GS and iPad. It turned out that we were using JSON library built-in three20, and that library was the cause. Problem solved by downloading new version of JSON library (apparently with this error fixed) in our case.

Kamil Nomtek.com