"Building for iOS, but the embedded framework 'xxx.framework' was built for iOS + iOS Simulator" "Building for iOS, but the embedded framework 'xxx.framework' was built for iOS + iOS Simulator" ios ios

"Building for iOS, but the embedded framework 'xxx.framework' was built for iOS + iOS Simulator"


Xcode Build Settings

It could be helped to try to set your "Validate Workspace" of "Build Options" in "Build Settings" as Yes.


Edit: This was an observation that could help those who use Carthage.

Apparently the most popular solution to this problem described in this answer.

setting Validate Workspace to Yes in the Build Settings tab

Also, the observation of this answer is correct

I'm afraid that this is actually the correct error and the frameworkshouldn't contain iOS and iOS Simulator code at the same time. Appletries to force us to use XCFramework for this purpose. They started itin XCode 11 and just tightened up the restrictions.

Every other solution (other than xcframework usage) seems to become increasingly temporary in the coming Xcode versions.


This is an issue if you are using Carthage and you have added a framework with Embed & Sign.

enter image description here

For this to work properly you have to follow the steps that Carthage page provide:

If you're building for iOS, tvOS, or watchOS

  1. Create a Cartfile that lists the frameworks you’d like to use in your project.

  2. Run carthage update. This will fetch dependencies into a Carthage/Checkouts folder, then build each one or download apre-compiled framework.

  3. Open your application targets’ General settings tab. For Xcode 11.0 and higher, in the "Frameworks, Libraries, and Embedded Content" section, drag and drop each framework you want to use from theCarthage/Build folder on disk. Then, in the "Embed" section,select "Do Not Embed" from the pulldown menu for each item added. ForXcode 10.x and lower, in the "Linked Frameworks and Libraries"section, drag and drop each framework you want to use from theCarthage/Build folder on disk.

  4. On your application targets’ Build Phases settings tab, click the + icon and choose New Run Script Phase. Create a Run Script in which you specify your shell (ex: /bin/sh), add the followingcontents to the script area below the shell:

    /usr/local/bin/carthage copy-frameworks
  5. Create a file named input.xcfilelist and a file named output.xcfilelist

  6. Add the paths to the frameworks you want to use to your input.xcfilelist. For example:

    $(SRCROOT)/Carthage/Build/iOS/Result.framework$(SRCROOT)/Carthage/Build/iOS/ReactiveSwift.framework$(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework
  7. Add the paths to the copied frameworks to the output.xcfilelist. For example:

    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Result.framework$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/ReactiveSwift.framework$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/ReactiveCocoa.framework

    With output files specified alongside the input files, Xcode only needs to run the script when the input files have changed or theoutput files are missing. This means dirty builds will be faster whenyou haven't rebuilt frameworks with Carthage.

  8. Add the input.xcfilelist to the "Input File Lists" section of the Carthage run script phase

  9. Add the output.xcfilelist to the "Output File Lists" section of the Carthage run script phase

Maybe this is a temporary fix for other cases also. (dependencies that are not build with Carthage)