xcode 7.1 swift 框架应用程序构建但不存档
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33580528/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xcode 7.1 swift framework app builds but not archiving
提问by parveenkhtkr
I have created a sample Framework in Swift, xcode 7.1. The framework is then built for Profiling, released version. Released framework then added(embedded) to an iOS test app.
我在 Swift 中创建了一个示例框架,xcode 7.1。然后为 Profiling 构建框架,发布版本。发布的框架然后添加(嵌入)到 iOS 测试应用程序。
The app builds fine, but when trying to archive it. An error occurs, stating "bitcode bundle could not be generated because '.../Test/FW.framework/FW' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64"
该应用程序构建良好,但在尝试存档时。出现错误,指出 “无法生成 bitcode bundle,因为 '.../Test/FW.framework/FW' 是在没有完整 bitcode 的情况下构建的。bitcode 的所有框架和 dylib 必须从 Xcode Archive 或 Install build for architecture arm64 生成”
The Framework and app projects are on default settings, Bitcode enabled for both.
框架和应用程序项目采用默认设置,两者都启用了 Bitcode。
To make sure Framework have bitcode, this command on Framework
为了确保框架有位码,框架上的这个命令
"otool -l FW.framework/FW | grep __LLVM"
“otool -l FW.framework/FW | grep __LLVM”
yields
产量
segname __LLVM
段名 __LLVM
segname __LLVM
段名 __LLVM
segname __LLVM
段名 __LLVM
segname __LLVM
段名 __LLVM
What am I missing? I have included both projects here, you can download them and try archiving.
我错过了什么?我在此处包含了这两个项目,您可以下载它们并尝试存档。
回答by Daij-Djan
xcode requires that bitcode for all embedded frameworks is generated during archiving.
xcode 要求在归档期间生成所有嵌入式框架的位码。
Copying the release build of framework/dylib isn't enough
复制框架/dylib 的发布版本是不够的
do
archive the framework and THEN use the archived version of the framework from then on.
做
归档框架,然后使用该框架的存档版本从那时起。
to get xcode to archive a framework (normally it only archives apps), set the build setting 'skip install' to NO for the framework target!
要让 xcode 归档框架(通常它只归档应用程序),请将框架目标的构建设置“跳过安装”设置为“否”!
回答by gbk
You can make the following if you can build the framework (for example if you use your own framework)
如果您可以构建框架,则可以进行以下操作(例如,如果您使用自己的框架)
This will allow your framework to provide the required bitcode.
这将允许您的框架提供所需的位码。
Another alternative option may be applicable if you dont have watchOS and Apple TV (according to docs)
如果您没有 watchOS 和 Apple TV,另一种选择可能适用(根据文档)
For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS and tvOS apps, bitcode is required.
对于 iOS 应用程序,位码是默认的,但可选的。如果您提供 bitcode,则应用程序包中的所有应用程序和框架都需要包含 bitcode。对于 watchOS 和 tvOS 应用程序,位码是必需的。
this option require to set ENABLE_BITCODE
for every target in buildSetting to NO
, but as expected this forbid to use bitcode functionality.
此选项需要将ENABLE_BITCODE
buildSetting 中的每个目标设置为NO
,但正如预期的那样,这禁止使用位码功能。
More about bitcode here
更多关于位码在这里