Xcode 4.3 / 4.4, Archive Build, Strip Static Library Bug

Sometimes it can be quite useful to hide a static library inside another one to hide the details of the inner static library from an application. We successfully did this with the Urban Airship library, but were having problems in a specific situation where the application would crash on first access of a method defined in the inner static library.

  1. Create an application that links against a static library (A), which in turn links against an already compiled static library (B)
  2. In the main application, write code that invokes a method defined in library (B)
  3. Archive the application
  4. Export the application into an IPA
  5. Run this IPA on a device
  6. Witness an EXC_CRASH (SIGSYS) in the crash log

I found the solution, which describes a bug in Xcode 4.3+. This still happens in Xcode 4.4.

“When performing an Archive action, Xcode uses the *project-level* build setting for STRIP_INSTALLED_PRODUCT rather than the target-level setting.”

More info here:

[Bug] Xcode Wrongly Applies Project Settings during Target Archive

 

Leave a Reply

Your email address will not be published. Required fields are marked *