Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Framework on device bitcode not included

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?

like image 395
Tomasz Czura Avatar asked Apr 06 '17 10:04

Tomasz Czura


2 Answers

If you are using cocoapods-binary with cocoapods

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

like image 81
Gabriel Goncalves Avatar answered Oct 20 '22 00:10

Gabriel Goncalves


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

like image 30
Mukund Agarwal Avatar answered Oct 20 '22 01:10

Mukund Agarwal