Reputation: 14113
Getting this error on Archiving my app. Framework used is my own. So I cross checked. Bitcode in framework is Enabled. Not sure why am I getting this issue. These are the build settings in my framework :
I followed this link but didn't work. Tried to set -fembed-bitcode in framework's project (not target, but project, since it is recommended in the link) setting.
Upvotes: 17
Views: 14785
Reputation: 11
In my case, I have a unity project, and I want to export it to the ios library to integrate with another project. So I need to archive it -> Xcode show "library was built without full bitcode"
My solution for this case is:
Hope it helpful
Upvotes: 1
Reputation: 16160
Project settings -> Select Framework Target -> Build settings
add -fembed-bitcode
in Other C Flags
click + Button -> Add User-Defined Setting
Key: BITCODE_GENERATION_MODE, value: bitcode
Build Active Architectures Only to Yes in Build settings.
Upvotes: 0
Reputation: 3098
if you do below commands
they will not work until
so that after you change build settings you need to run flutter build
Upvotes: 3
Reputation: 657
Build Settings -> User-Defined -> Add Setting BITCODE_GENERATION_MODE, then set value: bitcode
Upvotes: 0
Reputation: 316
Add to your project (no target), and for each project into your project (for example: Pods) one "User-Defined" in Build Settings:
BITCODE_GENERATION_MODE Debug = marker Release = bitcode
Upvotes: 0
Reputation: 404
For the next soul that comes by and had everything enabled as described in OP but still failed to archive the app using it here's what worked for me:
Upvotes: -1
Reputation: 9354
Try to set Skip Install to YES and Enable Bitcode to Yes in framework build settings.
Upvotes: 11
Reputation: 863
Bitcode is an abstract encoding of an app that can be used to re-compile it in different ways, given a set of instructions. You can confirm whether your binary is bitcode-compatible by running :
otool -l (my .o or .a file) | grep __LLVM
.
When you build normally, Xcode adds the build flag -fembed-bitcode-marker
to any clang invocation.
To Add -fembed-bitcode
: select project Build Settings -> Other C flags, set Debug to -fembed-bitcode-marker
and Release to -fembed-bitcode
this will build your lib with bitcode.
BITCODE_GENERATION_MODE
If you set BITCODE_GENERATION_MODE=bitcode
on your User-defined Setting, even during the build phase, the files will be compiled using the flag -fembed-bitcode
.
And, if you set BITCODE_GENERATION_MODE=marker
, the files will be compiled using the flag -fembed-bitcode-marker
, independent of the action phase.
So, if you want to enable the bitcode to every action (build and archive), the better way to do so is using the BITCODE_GENERATION_MODE
setting you can do so either manual or by script.
Manual
On Build Settings, click on the + sign at the top to add a user-defined build setting with the name BITCODE_GENERATION_MODE
, and set Debug to marker
, Release to bitcode
.
Edit schema as Release Then link the library.a file and get the build path get the library form Release folder
Script
xcodebuild BITCODE_GENERATION_MODE=bitcode OTHER_CFLAGS="-fembed-bitcode" -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
Upvotes: 13