我正在尝试使用Facebook SDK in Swift。它会在模拟器中以及在我的设备上本地运行并编译。但是,尝试存档或构建发行版配置失败。
ld: bitcode bundle could not be generated because '/.../DerivedData/FacebookSwift-xyz/Build/Products/Release-iphoneos/FBSDKCoreKit.framework/FBSDKCoreKit'
was built without full bitcode. All frameworks and dylibs for bitcode must be
generated from Xcode Archive or Install build file '/.../DerivedData/FacebookSwift-xyz/Build/Products/Release-iphoneos/FBSDKCoreKit.framework/FBSDKCoreKit'
for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
下载或克隆Facebook SDK in Swift项目,编辑FacebookCore
方案以构建发行版配置。
运行迦太基以降低依赖性,facebook-ios-sdk等。
现在构建项目将出现错误; bitcode bundle could not be generated because '.../FBSDKCoreKit' was built without full bitcode
FBSDKCoreKit
目标的“启用位码”设置为“是”。FacebookCore
目标还将“启用位码”设置为“是”。FacebookCore
目标具有2个目标依存关系;螺栓和FBSDKCoreKit都是动态框架版本。我尝试构建FBSDKCoreKit-Dynamic方案(在Release配置中),并且成功。生成的框架具有(据我所知)的位代码,正在运行:otool -l "/path/to/framework-binary" | grep -c __LLVM
返回4。
在二进制文件上运行file
会返回:
/.../FBSDKCoreKit.framework/FBSDKCoreKit: Mach-O universal binary with 2 architectures: [arm_v7:Mach-O dynamically linked shared library arm_v7] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
/.../FBSDKCoreKit.framework/FBSDKCoreKit (for architecture armv7): Mach-O dynamically linked shared library arm_v7
/.../Release-iphoneos/FBSDKCoreKit.framework/FBSDKCoreKit (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
facebook-sdk-swift
是0.31版facebook-ios-sdk
(Objective-C)是版本4.34 Latest iOS
)答案 0 :(得分:3)
这已经有一段时间了,我记得几个月前对此进行了调查。您的问题很可能位于目标操作系统版本(8.0)中。在FBSDKCoreKit中,从iOS11.0启用了位码标志。您可以尝试关闭主要目标的位码以进行编译。 (或者将目标操作系统版本提高到11,但我认为这不是一个选择)