IOS 4 application crashes on launch on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock

I am running Xcode 3.2.3 with the iOS 4.0 SDK. I created my application with basic SDK = iphoneos4.0, active SDK = iphoneos4.0, deployment target = 3.1.3 and architecture = standard (arm6 arm7). Compiler = GCC 4.2. As far as I understand, this is the right way to create an application for iOS 4 and 3.

The application works fine on devices running iOS 4. But when it starts, it starts when you try to run it on a device with iOS 3.1.3 (iPod Touch 1G):

dyld: Symbol not found: __NSConcreteStackBlock Referenced from: /var/mobile/Applications/192B30ED-16AC-431E-B0E9-67C1F41FD5DA/MyApp.app/MyApp Expected in: /usr/lib/libSystem.B.dylib 

It seems like the problem is with the dynamically linked "low level" library before my main () function is even called. I even tried restarting the device, etc., no luck. Here is part of the crash log:

 Process: MyApp [60] Path: /var/mobile/Applications/192B30ED-16AC-431E-B0E9-67C1F41FD5DA/MyApp.app/MyApp Identifier: MyApp Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2010-07-22 17:16:17.942 -0400 OS Version: iPhone OS 3.1.3 (7E18) Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x00000001, 0xe7ffdefe Crashed Thread: 0 Dyld Error Message: Symbol not found: __NSConcreteStackBlock Referenced from: /var/mobile/Applications/192B30ED-16AC-431E-B0E9-67C1F41FD5DA/MyApp.app/MyApp Expected in: /usr/lib/libSystem.B.dylib Dyld Version: 149 Binary Images: 0x1000 - 0x80fff +MyApp armv6 <d5f0ff6f233b4b034c222c16438c88d9> /var/mobile/Applications/192B30ED-16AC-431E-B0E9-67C1F41FD5DA/MyApp.app/MyApp 0x2fe00000 - 0x2fe26fff dyld armv6 <544395a4b5546114b878d5131a84fd7f> /usr/lib/dyld 0x30410000 - 0x30536fff libSystem.B.dylib armv6 <0373fd64e915a17160732b29d343f95f> /usr/lib/libSystem.B.dylib 

Thanks for any advice!

+46
ios iphone ios4
Jul 22 2018-10-22T00:
source share
3 answers

Ben Gottlieb noticed yesterday that if you use blocks anywhere in your application, you will see a crash similar to this on OSs up to 4.0 when created using the LLVM compiler. To get around this, you can specify the -weak-lSystem linker flag in the Xcode build settings.

+85
Jul 22 2018-10-22T00:
source share

Since most of these answers relate to Xcode 3.x, I just wanted to share what I did to fix this with Xcode 4.2.

For your purpose, on the "Phase Assembly" tab in the "Linking to Libraries" section, I added "libSystem.dylib" and made it optional. This fixed iOS 3.x issues while maintaining support for iOS 4.x and 5.0 devices.

+18
Nov 02 '11 at 18:42
source share

If you are using cocos2d libraries, there is a cleaner way to do this, you should set cocos2d deployment target to 3.0

+1
Nov 30 '10 at 11:31
source share



All Articles