15

I have created a sample Framework in Swift, xcode 7.1. The framework is then built for Profiling, released version. Released framework then added(embedded) to an iOS test app.

The app builds fine, but when trying to archive it. An error occurs, stating "bitcode bundle could not be generated because '.../Test/FW.framework/FW' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64"

The Framework and app projects are on default settings, Bitcode enabled for both.

To make sure Framework have bitcode, this command on Framework

"otool -l FW.framework/FW | grep __LLVM"

yields

segname __LLVM

segname __LLVM

segname __LLVM

segname __LLVM

What am I missing? I have included both projects here, you can download them and try archiving.

5
  • seems the bitcode formats don't match. was the framework exported via archiving it? Commented Nov 7, 2015 at 9:19
  • No, just built it for Profiling, then found the FW.framework in "Release-iphoneos" along with a separate file "FW.framework.dSYM". Commented Nov 7, 2015 at 9:21
  • How can I export it via archiving? When I archive the framework, it says build succeeded and nothing happens. Do I need to look for archived framework output file Commented Nov 7, 2015 at 9:22
  • 2
    maybe building for archiving works too but to allow it to be put into an archive, set the build setting 'skip install to NO' Commented Nov 7, 2015 at 9:23
  • 1
    That did the trick, thanks! I was going insane over this. Please add the steps as answer, I will accept it. ( 'skip install to NO' on framework project, then archive, export with save built product and that Framework output file works with bitcode enabled) Commented Nov 7, 2015 at 9:37

2 Answers 2

37

xcode requires that bitcode for all embedded frameworks is generated during archiving.

Copying the release build of framework/dylib isn't enough

do
archive the framework and THEN use the archived version of the framework from then on.

to get xcode to archive a framework (normally it only archives apps), set the build setting 'skip install' to NO for the framework target!

Sign up to request clarification or add additional context in comments.

12 Comments

It works, but not enough... Project now builds successfully with framework, but while uploading to iTunesConnect I receive an error...
` An error occurred during validation The archive did not contain <DVTFilePath:0x7f9bea07f750:'/Users/me/Library/Developer/Xcode/Archives/2015-12-16/Project_name 16-12-15 16.16.xcarchive/BCSymbolMaps/D1F093C6-C59A-3761-8C62-8D74B8629FB23.bcsymbolmap'> as expected.`
K. I'm lost. How do you produce it? Have you checked if it has module map at all?
The error occurred while uploading archive to iTunesConnect... Additional error info screenshot What do You mean with "checked if it has module map at all" ?
Thanks, setting the SKIP INSTALL to NO worked since the framework has to have to BITCODE to NO for a store upload. Then can export the archive to framework and then copy / use that for the app.
|
36

You can make the following if you can build the framework (for example if you use your own framework)

enter image description here

This will allow your framework to provide the required bitcode.


Another alternative option may be applicable if you dont have watchOS and Apple TV (according to docs)

For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS and tvOS apps, bitcode is required.

this option require to set ENABLE_BITCODE for every target in buildSetting to NO, but as expected this forbid to use bitcode functionality.

More about bitcode here

7 Comments

I think this answer should also get some credit. With this approach, you do not have to run the framework through the archive process.
this is a much better solution than the one that is the accepted answer. FYI to future people who might see this.
This worked for me, Building as Archive Did not. on XCode 8.3
Great answer. Worked for me, building as archive did not on XCode 9.0.
@Bem i have this issue : stackoverflow.com/questions/54437778/… adding BITCODE_GENERATION_MODE helped in this case also?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.