Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App with Static Lib ALWAYS crashes on Launch of Ad Hoc Archive Build. Cant reproduce in Xcode Debugger

We have an App built with a static Lib we are also building for distribution. The App and Lib run fine in Xcode debugger or when loaded on the device by Xcode debugging session. The App ALWAYS crashes as soon as we put an Ad Hoc Archive build on the device. Console log statements indicate it is crashing in Lib code, but crash report not symbolicating Lib code.

  • Can't reproduce in Xcode Simulator.
  • Guard malloc, Guard Edges show nothing (but these only run in simulator).
  • No leaks
  • Using Xcode 4.3.2
  • App targets 4.3 or later.
  • Lib targets 3.0 or later.
  • Other Linker Flags = -ObjC
  • Lib set as "Optional" in Target "Link Binaries With Libraries"
  • Thumb support off (using LLVM)

Seeing 2 exceptions on console that might be of use, but so far not turning anything up on net that helps much with this:

Application 'x' exited abnormally with signal 12: Bad system call: 12 (mostly)
Application 'x' exited abnormally with signal 12: Bad system call: 11 (rarely)

We saw the comment elsewhere that static libs with Recursion have issues. But we don't had any recursion in our Lib.

Stumped, need more ideas.

like image 285
Cliff Ribaudo Avatar asked Apr 24 '12 15:04

Cliff Ribaudo


1 Answers

Figured it out!! after 4 days of banging heads on desk. We don't know exactly why it works but it does. In case it's helpful to others here are the settings that resolved it for us. Set these in the "Deployment" section of the Static Library Project's Build Settings:

SET "STRIP LINKED PRODUCT" (STRIP_INSTALLED_PRODUCT) = NO
SET "STRIP STYLE" = DEBUGGING SYMBOLS.

We found this by trial and error but now notice that a few discussions online re setting up an Xcode project for building iOS static libraries use this setting. No discussion as to why, but there it is.

If anyone has any thoughts on why these lib settings fix it you might want to comment on it here.

like image 122
Cliff Ribaudo Avatar answered Oct 29 '22 13:10

Cliff Ribaudo