本文介绍了带有静态库的iOS App始终在启动Ad Hoc Archive Build时崩溃.无法在Xcode调试器中重现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用静态库构建的应用,我们也正在构建该库以进行分发. App和Lib在Xcode调试器中运行良好,或者在Xcode调试会话加载到设备上时运行良好.只要将Ad Hoc Archive版本建立在设备上,App总是会崩溃.控制台日志语句表明它在Lib代码中崩溃,但是崩溃报告并不表示Lib代码.

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.

  • 无法在Xcode Simulator中复制.
  • Guard malloc,Guard Edges不显示任何内容(但它们仅在模拟器中运行).
  • 没有泄漏
  • 使用Xcode 4.3.2
  • 应用定位到4.3或更高版本.
  • 库目标是3.0或更高版本.
  • 其他链接器标志= -ObjC
  • 在目标将二进制文件与库链接"中将库设置为可选"
  • 关闭拇指支持(使用LLVM)

在控制台上看到2个可能有用的异常,但是到目前为止,在网络上没有发现任何异常,对此有很大帮助:

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)

我们在其他地方看到了带有Recursion的静态库存在问题的评论.但是我们的库中没有任何递归.

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.

推荐答案

弄清楚了!!我们不知道确切为什么会起作用,但确实可以.万一这对其他人有帮助,以下是为我们解决了该问题的设置.在静态库项目的构建设置"的部署"部分中进行设置:

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.

我们通过反复试验发现了此问题,但现在注意到,网上进行的一些讨论都重新设置了用于构建iOS静态库的Xcode项目,使用了该设置.没有讨论为什么,但是有.

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.

如果任何人对这些lib设置为何能解决问题有任何想法,则可能要在这里发表评论.

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

这篇关于带有静态库的iOS App始终在启动Ad Hoc Archive Build时崩溃.无法在Xcode调试器中重现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 19:48