Reputation: 2434
I am developing static library for iOS, in which I am using Alamofire. When I try to build for release for simulator, everything is ok, however when I try to build it for device (release or debug) I get following problem:
ld: bitcode bundle could not be generated because '/PathToMyLibraryProducts/Release-iphoneos/Alamofire/Alamofire.framework/Alamofire' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture armv7
My framework has enabled bitcode, and it is fat framework (build for device and simulator). How can I resolve that?
Upvotes: 9
Views: 6669
Reputation: 836
Add this code in your pod file, It will enable Bitcode for all the framework.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
end
end
end
Upvotes: 0
Reputation: 5160
This error will appear since cocoapods-binary won't generate frameworks with bitcode enabled unless you specifically indicate that by using this key in your Podfile
:
enable_bitcode_for_prebuilt_frameworks
This is how your Podfile will look:
plugin 'cocoapods-binary'
platform :ios, '12.0'
use_frameworks!
enable_bitcode_for_prebuilt_frameworks!
all_binary!
target 'ProjectName' do
pod 'Alamofire'
end
Upvotes: 5
Reputation: 9540
I think, bitcode
is not enabled while you are building for Generic Device
. So do the following:
pods.xcodeproj
, select all pods target.Build Settings
and make sure that all your
"Pods" > "Build Settings" > "Build Active Architecture Only" is set
to "NO".Bitcode
set to YES
Archive
Upvotes: 1
Reputation: 585
Found this discussion which may be relevant
In summary the following setting is needed: BITCODE_GENERATION_MODE=bitcode for Release builds and BITCODE_GENERATION_MODE=marker for Debug builds
Hope that helps.
Kind regards, Mukund
Upvotes: 1