3

My app is crashing on 3.1.3 because of this NSConcreteBlock error. I read the other post on this topic, and the answer was to weak link the libSystem.B.dylib.

However, I am not including that library in my app at all, and I'm still getting the same bug.

What else could be causing this crash?

Here is the log:

Code Type: ARM (Native) Parent Process: launchd 1

Date/Time: 2011-10-20 14:05:08.189 -0700 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 Expected in: /usr/lib/libSystem.B.dylib Dyld Version: 149

Community
  • 1
  • 1
Andrew Johnson
  • 13,108
  • 13
  • 75
  • 116

5 Answers5

3

However, I am not including that library in my app at all, and I'm still getting the same bug.

Except that there’s no escape from libSystem since it implements, amongst other things, the standard C runtime library. Whenever you compile an Objective-C program, the compiler automatically links libSystem. And, if you inspect system frameworks such as UIKit or Foundation via otool -L, you’ll find that they’re linked to libSystem as well.

This means that the solution described by Bard Larson in this answer should work for you as well.

Community
  • 1
  • 1
1

Blocks are an Objective-C language feature introduced in iOS 4.0 - it will never work on iOS 3.x.

odrm
  • 5,149
  • 1
  • 18
  • 13
1

You have probably seen this, but it's still worth a shot: http://longweekendmobile.com/2011/03/15/the-backwards-compatibility-blues-supporting-ios-3-1-4-2/

There they say that even if you do not use blocks in your code, the libSystem references them, so weak linking the libSystem should also work for you.

  • I am not linking the libSystem library at all. Should I link it, and then weak-link it? I had thought you only weak-link it if you had already been linking it - am I mistaken? Is there some sort of non-explicit link I would be overriding? – Andrew Johnson Oct 28 '11 at 00:10
  • @AndrewJohnson it appears that libSystem.B.dylib is somehow automatically linked even though it isn't directly linked by the project. You don't need to link it, you just need to use the `-weak-lSystem` flag. – ThomasW Nov 22 '11 at 03:18
-1

Under build settings make sure your C/C++ Compiler version is LLVM GCC and not GCC.

gamozzii
  • 3,911
  • 1
  • 30
  • 34
-1

You may not be using any block based methods, but you may be using some methods that are using some UIKit methods that are now using block based methods internally. You might want to check the following:

  1. Check that your deployment target in the Build Settings is set to 3.1.3.
  2. Are you potentially using any new or updated methods from iOS4 or 5? i.e. a method that could now be calling/executing a block behind the scenes

as others have stated, perhaps you could weak link the libSystem library as a last resort.

Good luck

timthetoolman
  • 4,613
  • 1
  • 22
  • 22