Embedding an xcframework in another xcframework.

Anytime I try to embed my xcframework (which has another xcframework embedded in it) in an iOS app and run it on a device I get this error in the console :

dyld[5028]: Library not loaded: @rpath/Calculator.framework/Calculator

  Referenced from:...

It runs fine on the simulator however. I've tried several suggested solutions; modifying Runpath Search Paths, Framework Search Paths but to no avail.

Is there something I'm missing or you can't have nested frameworks for iOS as per this question? If so why does it run on the simulator though.

you can't have nested frameworks for iOS as per this question?

As stated in the other thread, nested frameworks are not supported on iOS. This is noted in TN 2435:

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.

@enkkashley

I'm building a framework that has some third party dependencies. I was provided two sets of dependency framework files, one for iOS simulator (x86_64, arm64) and one for iOS (arm64). Following Apple's documentation for building an xcframework, I made an archive for each of these, with their respective dependency framework files, then made the xcframework. Now when I use the xcframework in my project, it works great for both iOS devices and simulator, but when I try to deploy to testflight I get an error saying:

"Invalid Bundle. The bundle at ... contains disallowed nested bundles"

How can I build my framework in a way that is universal, but also doesn't contain nested bundles, keeping in mind I have 2 sets of dependency frameworks for different platforms/architectures?

I detailed this issue further in this thread: https://forums.developer.apple.com/forums/thread/761604

Embedding an xcframework in another xcframework.
 
 
Q