34

I have a project with a framework target, but when I archive, the framework does not show up in organizer. I checked apple for documentation, but only found reference for static libraries.

Has anyone experienced this before?

Here are screenshots of my current scheme settings Build Scheme Release Scheme

72A12F4E
  • 1,744
  • 1
  • 14
  • 28

4 Answers4

22

Go into your framework and build.

cmd+b

You will find in your products YOUR_FRAMEWORK.framework

enter image description here

Right click on "YourLibrary.framework" -> Show in Finder

enter image description here

Now you can share/import your library.

Attention: Don't link/reference to this path because the framework is stored in Derived Data.

kuzdu
  • 7,124
  • 1
  • 51
  • 69
  • This build is not through archiving. Something only effective on archiving (e.g ENABLE_BITCODE) will not take effect. How do we handle this? – Ting Yi Shih Jun 08 '20 at 03:46
2

The steps are documented by Apple here

Set up the project

To set up your project for creating an XCFramework, ensure your Xcode project has a scheme that builds only the framework target and its dependencies.

Configure these build settings on your target:

Set the Build Libraries for Distribution build setting to Yes. For Swift, this enables support for library evolution and generation of a module interface file.

Set the Skip Install build setting to No. If enabled, the built products aren‘t included in the archives.

Leave the Architectures build setting unset. The predefined value configures the target to build a universal binary for all the possible architectures the target platform uses.

Then you can use Archive to build your framework for Release.

Once built, the Organizer window will open. You can then click on Distribute Content -> Build Products and export your framework.

Steven
  • 1,088
  • 1
  • 8
  • 16
0

The only thing you should do is build the target,then show Products in finder ,you will see it.

Finder丶Tiwk
  • 345
  • 2
  • 8
0

Archive framework

Product -> Archive
//or
xcodebuild archive

[Archive location]

Xcode v12 does not have such problem and when you try to archive a framework Xcode prompt you to corresponding Archives window

Archive is an action from Scheme[About] which is competitor for Build action. Archive includes Build with additional logic. For example Archive is used for XCFramework[Example] which additionally can contains .dSYM and .BCSymbolMap files

For usual purposes you can just use Build action, it creates a corresponding .framework file in a Build location[About]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205