I'm trying to use Facebook SDK in Swift. It will compile and run in the Simulator and locally on my device. However, trying to Archive or build in the release configuration fails.
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)
Download or clone the Facebook SDK in Swift project, edit the FacebookCore
scheme to build the release configuration.
Run Carthage to pull down the dependancies, facebook-ios-sdk et al.
Building the project will now give the error; bitcode bundle could not be generated because '.../FBSDKCoreKit' was built without full bitcode
FBSDKCoreKit
target in the FBSDKCoreKit sub-project has "Enable Bitcode" set to "YES".FacebookCore
target also has "Enable Bitcode" set to "YES".FacebookCore
target has 2 target dependancies; Bolts and FBSDKCoreKit, both are the Dynamic framework versions.I have attempted to build the FBSDKCoreKit-Dynamic scheme (in Release config) and that succeeds. The resulting Framework has bitcode (as far as I can tell), running: otool -l "/path/to/framework-binary" | grep -c __LLVM
returns 4.
Running file
on the binary returns:
/.../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
is version 0.31facebook-ios-sdk
(Objective-C) is version 4.34Latest iOS
)This has been an issue for quite a while now, I remember investigating it a few months back. Your problem lies - most likely - in the target OS version(8.0). In FBSDKCoreKit the bitcode flag is enabled from iOS11.0. You could try and turn off bitcode for the main target to let it compile. (Or bump up the targeted os version to 11 but I suppose that isn't an option)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With