Framework was built without full bitcode - Framework bitcode already enabled
Asked Answered
D

8

17

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 :

enter image description here

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.

Dilemma answered 6/12, 2018 at 10:51 Comment(0)
C
11

Try to set Skip Install to YES and Enable Bitcode to Yes in framework build settings.

Skip Install

Embed Bitcode

Countercurrent answered 11/12, 2018 at 0:9 Comment(4)
@ViktorVostrikov how do you export your framework? Do you use Build->Archive?Countercurrent
No I did not used archivedDreyfus
try to export framework using Build->Archive and then export build product to some folderCountercurrent
@VitaliyGozhenko i try to archive and export my framework via build product to some folder but exported products folder is emptySidetrack
U
13

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

Unconditional answered 13/12, 2018 at 10:4 Comment(2)
not working... maybe you can comment on my post? Would be really grateful. #54082611Dreyfus
@JhonnyTawk, I upvoted your answer cause you're basically saying what this answer said: https://mcmap.net/q/94024/-xcode-7-1-swift-framework-app-builds-but-not-archiving ... yours is just a bit difficult to read but thanks. It pointed me in the right directionMarymarya
C
11

Try to set Skip Install to YES and Enable Bitcode to Yes in framework build settings.

Skip Install

Embed Bitcode

Countercurrent answered 11/12, 2018 at 0:9 Comment(4)
@ViktorVostrikov how do you export your framework? Do you use Build->Archive?Countercurrent
No I did not used archivedDreyfus
try to export framework using Build->Archive and then export build product to some folderCountercurrent
@VitaliyGozhenko i try to archive and export my framework via build product to some folder but exported products folder is emptySidetrack
J
3

if you do below commands

  • Enable Bitcode' set to 'YES' Adding
  • Flags' Adding 'BITCODE_GENERATION_MODE' with the value 'bitcode' set skip install to yes

they will not work until

  • flutter clean
  • flutter build ios

so that after you change build settings you need to run flutter build

Jun answered 25/8, 2020 at 12:15 Comment(0)
S
1

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:

  • Target -> Framework need archive -> Build setting -> Enable bitcode = NO

enter image description here

Hope it helpful

Serviette answered 21/1, 2022 at 2:59 Comment(0)
G
0

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

Glutamate answered 7/2, 2020 at 11:52 Comment(0)
N
0

Build Settings -> User-Defined -> Add Setting BITCODE_GENERATION_MODE, then set value: bitcode

Nowak answered 26/5, 2020 at 3:21 Comment(0)
D
0
  • 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.

Daube answered 30/10, 2020 at 14:8 Comment(0)
G
-1

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:

  1. Set up everything as stated in the OP.
  2. Archive the product
  3. Export it to your own filesystem
  4. Find the exported mySadLittleFramework.xcarchive
  5. Right click the file, chose Show Package Content
  6. Product -> Library -> Frameworks will contain mySadLittleFramework.framework file
  7. Drag/copy that file somewhere.
  8. Add that file to your app project as framework.
  9. Archive the app.
Ge answered 29/1, 2020 at 13:50 Comment(2)
No Library folder under ProductClinician
If Skip Install is set to True for Release configuration, there won't be Library/Frameworks under ProductPhysoclistous

© 2022 - 2024 — McMap. All rights reserved.