3

Can I use a .xcframework inside a .framework?

When I try this the framework target builds fine, but when I use this framework in an iOS app target, it gives build error

For eg:

MyApp is iOS app target
MyFramework is a framework (embedded in MyApp)
MyXcFramework is a xcframework (embedded in MyFramework)

A sample swift file inside MyFramework contains

import Foundation
import MyXcFramework

and builds successfully

But when MyFramework is added to MyAapp i get the following error

import Foundation
import MyXcFramework <- No such module MyXcFramework

Can anyone help what I am doing wrong?

1
  • How does your framework search path look like? Commented May 31, 2020 at 14:56

2 Answers 2

1

It seems like you are trying to use the xcframework without adding it to the app. If you want to use your xcframework in your app too you have to add that xcframework in your app target, you can avoid embedding xcframework in the framework and only embed for the app itself.

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

Comments

0

According to the documentation, it is not allowed in iOS. Apps with Dependencies Between Frameworks

An umbrella framework is a framework bundle that contains other frameworks. While it is possible to create umbrella frameworks for macOS apps, doing so is unnecessary for most developers and is not recommended. Umbrella frameworks are not supported on iOS, watchOS, or tvOS.

I had a framework, that had subframework, everything compiled sucessfuly, I shared the app with Diawi link. QA approved the build. When I tried to upload the build I had following error. TestFlight upload error

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.