I am directly linking PLCrashReporter in my iOS app without using any external tool and now when I try to compile it on Xcode 7 I get link error:
我在我的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
“…/CrashReporter.framework/CrashReporter(libCrashReporter-iphoneos.a-armv7-master.o)”不包含bitcode。您必须使用启用了bitcode的(Xcode设置ENABLE_BITCODE)来重新构建它,从供应商获得一个更新的库,或者为这个目标禁用bitcode。建筑v7
Where do I get the updated framework or the sources to compile them with bitcode enabled and get rid of the error without disabling bitcode for the full project?
我在哪里可以得到更新的框架或源代码来编译它们,并启用了bitcode,并在不禁用整个项目的bitcode的情况下去掉了错误?
5 个解决方案
#1
8
I ended up addressing this by building PLCrashReporter 1.2.1 from source. This version is the minimum that has had Xcode 7 and iOS9 fixes merged.
最后,我通过从源代码构建PLCrashReporter 1.2.1来解决这个问题。这个版本是Xcode 7和iOS9补丁合并的最小值。
The source is obtained from here: PLCrashReporter 1.2.1
来源从这里获得:PLCrashReporter 1.2.1。
Unzip the downloaded 1.2.1 source into a folder.
将下载的1.2.1源代码解压到一个文件夹中。
Pull the Xcode project inside that folder up within Xcode and add the following to the Custom Compiler Settings "Other C Flags" section of the project build settings: -fembed-bitcode
将Xcode项目放入Xcode中的文件夹中,并将以下内容添加到项目构建设置的“其他C标志”部分的自定义编译器设置:-femb -bitcode。
Next add the following to the Custom Compiler Settings "Other Warning Flags" section of the project build settings: -Wno-error=unused-command-line-argument
接下来,将以下内容添加到项目构建设置的“其他警告标志”部分的自定义编译器设置:-Wno-error=未使用命令行参数。
Then close the project from the Xcode GUI. The custom settings are necessary because we are going to build from the command line using xcodebuild to avoid the PLCR deprecation errors, and when doing so the default is only -fembed-bitcode-marker when building a framework this way. We are overriding the default behavior, and need to suppress the hard stop warning this causes.
然后从Xcode GUI关闭项目。自定义设置是必要的,因为我们将使用xcodebuild从命令行构建,以避免PLCR的弃用错误,并且当这样做时,默认情况下只有- fembitcode标记,以这种方式构建一个框架。我们正在重写默认的行为,并且需要抑制这个导致的严重停止警告。
Lastly, from a terminal window prompt within the folder where the zip file of the source including the xcode project file is located run the following:
最后,从源文件的zip文件(包括xcode项目文件)所在文件夹的终端窗口提示中运行如下:
xcodebuild -configuration Release -target 'Disk Image'
xcodebuild -配置释放-目标“磁盘映像”
This will run the build and leave the framework in ./build/Release/PLCrashReporter-1.2.1/iOS Framework
这将运行构建并离开框架。/build/Release/PLCrashReporter-1.2.1/iOS框架。
Now, these steps will produce a bitcode enabled framework, but third party crash reporting is incompatible with bitcode (when the App Store recompiles you have no way to get the symbol file from that on the fly build).
现在,这些步骤将生成一个支持bitcode的框架,但是第三方的崩溃报告与bitcode不兼容(当应用程序商店重新编译时,您无法从该文件中获取该符号文件)。
#2
3
There is 2 options.
1. Download PLCrashReporter sources and compile it whit bitcode enabled, and use that in your project.
2. Disable bitcode for your target
Go to your target's Build Settings tab, search for Enable Bitcode
set value to NO.
有两个选择。1。下载PLCrashReporter源代码并编译它,并在您的项目中使用它。2。禁用您的目标的位代码到您的目标的Build Settings选项卡,搜索启用位码设置值为NO。
#3
2
This worked for me, in order to include Rollbar framework in my project:
这对我来说很有效,为了在我的项目中包括滚动条框架:
Within my workspace, I first select my project from the Project Navigator -> my project's target -> Build Settings -> Enable Bitcode = NO
在我的工作空间中,我首先从项目导航器中选择我的项目->我的项目的目标->构建设置->启用Bitcode = NO。
Then I select the PODS from the Project Navigator -> Rollbar Target -> Enable Bitcode = NO
然后我从Project Navigator -> Rollbar目标->启用Bitcode = NO,选择pod。
#4
1
Experienced same issue. I built the crash reporter framework from source using https://www.plcrashreporter.org/code
经历过同样的问题。我使用https://www.plcrashreporter.org/code从源代码构建了crashreporter框架。
- Open it in Xcode
- 在Xcode中打开它
- Select the 'CrashReporter' target with the red bullseye.
- 选择“CrashReporter”的目标和红色的靶心。
- Build it
- 构建它
Then search in ~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx to get the .framework bundle
然后在~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx中搜索得到.framework包。
#5
0
Unfortunately the issue presented itself again. Also when I try to compile again I get:
不幸的是,这个问题再次出现。当我再次尝试编译时,我得到:
ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(cf.o)) was built for newer OSX version (10.6) than being linked (10.5) ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o)) was built for newer OSX version (10.6) than being linked (10.5)
警告:对象文件(/ application /Xcode.app/内容/开发者/工具链/XcodeDefault.xctoolchain/usr/lib/arc/ libarclite_macosxa .)是为较新的OSX版本(10.6)构建的,而不是链接(10.5)ld:警告:对象文件(/应用程序/Xcode.app/内容/开发者/工具链/XcodeDefault.xctoolchain/usr/lib/arc/ libarclite_macosxa .)构建于较新的OSX版本(10.6),而不是链接(10.5)
Moreover if I set enable bit code at the project level I get an immediate error: target 'CrashReporter-MacOSX-Static' has bitcode enabled (ENABLE_BITCODE = YES), but it is not supported for the 'macosx' platform
此外,如果我在项目级别设置了启用位代码,我就会得到一个立即的错误:target 'CrashReporter-MacOSX-Static'已经启用了位代码(ENABLE_BITCODE = YES),但它不支持'macosx'平台。
What should I do to produce the framework with bitcode enabled?
我应该怎样做才能生成启用了位码的框架?
#1
8
I ended up addressing this by building PLCrashReporter 1.2.1 from source. This version is the minimum that has had Xcode 7 and iOS9 fixes merged.
最后,我通过从源代码构建PLCrashReporter 1.2.1来解决这个问题。这个版本是Xcode 7和iOS9补丁合并的最小值。
The source is obtained from here: PLCrashReporter 1.2.1
来源从这里获得:PLCrashReporter 1.2.1。
Unzip the downloaded 1.2.1 source into a folder.
将下载的1.2.1源代码解压到一个文件夹中。
Pull the Xcode project inside that folder up within Xcode and add the following to the Custom Compiler Settings "Other C Flags" section of the project build settings: -fembed-bitcode
将Xcode项目放入Xcode中的文件夹中,并将以下内容添加到项目构建设置的“其他C标志”部分的自定义编译器设置:-femb -bitcode。
Next add the following to the Custom Compiler Settings "Other Warning Flags" section of the project build settings: -Wno-error=unused-command-line-argument
接下来,将以下内容添加到项目构建设置的“其他警告标志”部分的自定义编译器设置:-Wno-error=未使用命令行参数。
Then close the project from the Xcode GUI. The custom settings are necessary because we are going to build from the command line using xcodebuild to avoid the PLCR deprecation errors, and when doing so the default is only -fembed-bitcode-marker when building a framework this way. We are overriding the default behavior, and need to suppress the hard stop warning this causes.
然后从Xcode GUI关闭项目。自定义设置是必要的,因为我们将使用xcodebuild从命令行构建,以避免PLCR的弃用错误,并且当这样做时,默认情况下只有- fembitcode标记,以这种方式构建一个框架。我们正在重写默认的行为,并且需要抑制这个导致的严重停止警告。
Lastly, from a terminal window prompt within the folder where the zip file of the source including the xcode project file is located run the following:
最后,从源文件的zip文件(包括xcode项目文件)所在文件夹的终端窗口提示中运行如下:
xcodebuild -configuration Release -target 'Disk Image'
xcodebuild -配置释放-目标“磁盘映像”
This will run the build and leave the framework in ./build/Release/PLCrashReporter-1.2.1/iOS Framework
这将运行构建并离开框架。/build/Release/PLCrashReporter-1.2.1/iOS框架。
Now, these steps will produce a bitcode enabled framework, but third party crash reporting is incompatible with bitcode (when the App Store recompiles you have no way to get the symbol file from that on the fly build).
现在,这些步骤将生成一个支持bitcode的框架,但是第三方的崩溃报告与bitcode不兼容(当应用程序商店重新编译时,您无法从该文件中获取该符号文件)。
#2
3
There is 2 options.
1. Download PLCrashReporter sources and compile it whit bitcode enabled, and use that in your project.
2. Disable bitcode for your target
Go to your target's Build Settings tab, search for Enable Bitcode
set value to NO.
有两个选择。1。下载PLCrashReporter源代码并编译它,并在您的项目中使用它。2。禁用您的目标的位代码到您的目标的Build Settings选项卡,搜索启用位码设置值为NO。
#3
2
This worked for me, in order to include Rollbar framework in my project:
这对我来说很有效,为了在我的项目中包括滚动条框架:
Within my workspace, I first select my project from the Project Navigator -> my project's target -> Build Settings -> Enable Bitcode = NO
在我的工作空间中,我首先从项目导航器中选择我的项目->我的项目的目标->构建设置->启用Bitcode = NO。
Then I select the PODS from the Project Navigator -> Rollbar Target -> Enable Bitcode = NO
然后我从Project Navigator -> Rollbar目标->启用Bitcode = NO,选择pod。
#4
1
Experienced same issue. I built the crash reporter framework from source using https://www.plcrashreporter.org/code
经历过同样的问题。我使用https://www.plcrashreporter.org/code从源代码构建了crashreporter框架。
- Open it in Xcode
- 在Xcode中打开它
- Select the 'CrashReporter' target with the red bullseye.
- 选择“CrashReporter”的目标和红色的靶心。
- Build it
- 构建它
Then search in ~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx to get the .framework bundle
然后在~/Library/Developer/Xcode/DerivedData/CrashReporter-xxxxxxx中搜索得到.framework包。
#5
0
Unfortunately the issue presented itself again. Also when I try to compile again I get:
不幸的是,这个问题再次出现。当我再次尝试编译时,我得到:
ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(cf.o)) was built for newer OSX version (10.6) than being linked (10.5) ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a(arclite.o)) was built for newer OSX version (10.6) than being linked (10.5)
警告:对象文件(/ application /Xcode.app/内容/开发者/工具链/XcodeDefault.xctoolchain/usr/lib/arc/ libarclite_macosxa .)是为较新的OSX版本(10.6)构建的,而不是链接(10.5)ld:警告:对象文件(/应用程序/Xcode.app/内容/开发者/工具链/XcodeDefault.xctoolchain/usr/lib/arc/ libarclite_macosxa .)构建于较新的OSX版本(10.6),而不是链接(10.5)
Moreover if I set enable bit code at the project level I get an immediate error: target 'CrashReporter-MacOSX-Static' has bitcode enabled (ENABLE_BITCODE = YES), but it is not supported for the 'macosx' platform
此外,如果我在项目级别设置了启用位代码,我就会得到一个立即的错误:target 'CrashReporter-MacOSX-Static'已经启用了位代码(ENABLE_BITCODE = YES),但它不支持'macosx'平台。
What should I do to produce the framework with bitcode enabled?
我应该怎样做才能生成启用了位码的框架?