Skip to content
Home » Building for iOS Simulator but the linked and embedded framework ‘My.framework’ was built for iOS + iOS Simulator

Building for iOS Simulator but the linked and embedded framework ‘My.framework’ was built for iOS + iOS Simulator

To solve Building for iOS Simulator but the linked and embedded framework ‘My.framework’ was built for iOS + iOS Simulator error follow below methods.

ERROR LOG

Building for iOS Simulator but the linked and embedded framework 'My.framework' was built for iOS + iOS Simulator

How to solve Building for iOS Simulator but the linked and embedded framework ‘My.framework’ was built for iOS + iOS Simulator ?

Unfortunately, this is the proper issue, and the framework should not contain both iOS and iOS Simulator code at the same time. Apple is attempting to compel us to utilise XCFrameworks for this purpose. They began with XCode 11 and simply strengthened the constraints.

The only proper solution is to rebuild the framework as an XCFramework. Which is simple to do:

$ xcrun xcodebuild -create-xcframework \
    -framework /path/to/ios.framework \
    -framework /path/to/sim.framework \
    -output combined.xcframework

Starting with a combined .framework, make two copies of the framework, and use lipo to extract the binary slices associated with each SDK.

Alternative to Solve Building for iOS Simulator but the linked and embedded framework ‘My.framework’ was built for iOS + iOS Simulator

When building for the simulator, you must exclude device architectures, and when building for the device, you must exclude simulator architectures.

To do so, go to your project’s Build Settings -> Excluded Architectures -> Choose a configuration (Debug/Release/etc…) -> Tap + -> Any SDK for iOS Simulator -> Add arm64, arm64e, and armv7.

Similarly, include x86_64 and i386 in Any iOS SDK.

Hope the above solution works.

Also read :

You have missing dependencies! Mandatory : spyder kernels >= 2.0.1 <2.1.0 : 2.0.1 (NOK)
Execution failed for task ‘:app:checkDebugAarMetadata’