Building for iOS Simulator, but the linked framework '****.framework' was built for iOS

I cannot run my app on simulators anymore. Online suggested that I edit my project.pbxproj, but that does not appear to work. How do I reclaim the ability to run my project on my simulator (and remain able to do so on a device)? I am working on another project that uses many of the same frameworks, but it runs on a simulator. What would cause a similar framework to work in one project but not in another?


Solution 1:

Xcode 12.3

In my case I solved this problem by simply setting Validate Workspace to Yes in the Build Settings tab

enter image description here

Solution 2:

No doubt that the fix in case of Xcode 12.3 is to setup the Validate Workspace property in the target's build setting. However if you check the diff after this change, the reason of the build error is the missing parameter (VALIDATE_WORKSPACE) from the project file, not the value of the parameter. So you don't need the value to be YES. You need to add the value to the project settings and you can leave it on the default value (NO). At the first time, it shows up in the Build Settings with NO, but only because that is the default value of the missing parameter.

TLDR; Without changing your project setup, go to your target's build settings, find "Validate Workspace", set it to YES, then set back to NO.

Solution 3:

It happened to me when I added my custom framework into the project and after I updated my Xcode, I encountered the same issue.

Solution : under build settings in project search for Validate workspace Just change to yes which is by default set to no

enter image description here