ios - Xcode 7 'CrashReporter does not contain bitcode' 链接器错误

标签 ios xcode xcode7 plcrashreporter bitcode

我在我的 iOS 应用程序中直接链接 PLCrashReporter,而不使用任何外部工具,现在当我尝试在 Xcode 7 上编译它时,出现链接错误:

ld: '.../CrashReporter.framework/CrashReporter(libCrashReporter-iphoneos.a-armv7-master.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7

我从哪里获得更新的框架或源代码以在启用 bitcode 的情况下编译它们并在不为整个项目禁用 bitcode 的情况下消除错误?

最佳答案

我最终通过从源代码构建 PLCrashReporter 1.2.1 解决了这个问题。此版本是合并了 Xcode 7 和 iOS9 修复程序的最低版本。

来源是从这里获得的:PLCrashReporter 1.2.1

将下载的 1.2.1 源解压缩到一个文件夹中。

在 Xcode 中将该文件夹中的 Xcode 项目向上拉,并将以下内容添加到项目build设置的自定义编译器设置“其他 cflags”部分:-fembed-bitcode

接下来将以下内容添加到项目build设置的自定义编译器设置“其他警告标志”部分:-Wno-error=unused-command-line-argument

然后从 Xcode GUI 关闭项目。自定义设置是必要的,因为我们将使用 xcodebuild 从命令行构建以避免 PLCR 弃用错误,并且在这样做时,默认情况下只有 -fembed-bitcode-marker 以这种方式构建框架。我们正在覆盖默认行为,并且需要抑制由此导致的硬停止警告。

最后,在包含 xcode 项目文件的源 zip 文件所在文件夹中的终端窗口提示符下运行以下命令:

xcodebuild -configuration Release -target 'Disk Image'

这将运行构建并将框架留在 ./build/Release/PLCrashReporter-1.2.1/iOS Framework

现在,这些步骤将生成一个启用位码的框架,但第三方崩溃报告与位码不兼容(当 App Store 重新编译时,您无法从动态构建中获取符号文件)。

关于ios - Xcode 7 'CrashReporter does not contain bitcode' 链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32525916/

相关文章:

ios - Storyboard和 CustomCells

ios - 运行发布或调试时在 ios 上 react native 应用程序崩溃

ios - 是否可以制作包含SwiftUI的Swift项目模板?

ios - 获取结果 Controller 中没有单元格的空部分(标题 View )

ios - 披露指示器移动单元格 subview

Xcode 3.2 调试 : Seeing whats in a string?

ios - 使用 xcode 7 将 cordova 基础版本上传到应用程序商店,错误 itms-90032 在 key 'CFBundleIconFile' : 'icon.png' 下找不到图像

c++ - 仅当尝试在 Xcode 7.1 中使用 Instruments 时出现有关 Boost 文件的编译器错误

ios - Google Map SDK 和 iOS,observeValueForKeyPath 问题

ios - NSBundleResourceRequest bundlePath