Marcus Rossel Marcus Rossel - 1 year ago 94
Swift Question

Swift - `.framework` file is not generated

So I just followed this very short tutorial on how to create a framework with Swift.

At one point, the author of the article does this:

enter image description here

This leads him to this:

enter image description here

When I try to do the same, nothing happens though (Finder is never opened). So I thought I could just manually navigate to the project's folder to find the

file. But it seems, that such a file is simply never generated:

enter image description here

And even after searching for
in Spotlight, nothing is found.

A noteworthy detail is also, that in Xcode, the 'Products' are shown in red:

enter image description here

Why is the
file not generating?

Answer Source

The framework is being generated, but it is located within Xcode's DerivedData directory where your project is built, not the directory where your framework's source files are located.

Your target's path is likely not correct, which is why the product's name appears in red, and Finder can't open a window to that directory.

The location for the framework should be ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework, which (for the Debug configuration) would expand to:

~/Library/Developer/Xcode/DerivedData/SortedList-<random suffix>/Build/Products/Debug-iphoneos/SortedList.framework`


If you select the framework product, then look in the Utilities -> File Inspector pane, you should see that its name is SortedList.framework, its type is Framework, and its location is Relative to Build Products.

The full path shown below that should automatically correspond to the DerivedData location for the framework.

Here's an example of what a framework's File Location pane would look like.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download