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

可紊 提交于 2020-12-21 06:21:12

问题


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?


回答1:


Xcode 12.3

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




回答2:


possible reason would be

  1. framework which you are using may not be built for simulator architecture(x86_64), you can check the compatibility by going to framework folder (framework_name.framework --> modules --->framework_name.swiiftModule-->) in this path you should see arm/i386/x86_64 support files
  2. if you have updated to new Xcode, the frameworks you are using are not compatible to the newer compiler version, so vendor needs to share the recent compatible one, in this case you will not be able to run on both device and simulator



回答3:


For XCODE 12.3 the latest one - If you face this issue -

Here is a fix

Under Build Settings - Navigate to Validate Workspace - Change it to YES (By Default its NO)




回答4:


I suppose the framework you are linking was built only for arm architecture. You won't be able to run it in a simulator. You will need an author of the framework to build a "universal framework".




回答5:


I needed to remove the framework then add it again, which also embedded it--which it wasn't before.




回答6:


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.




回答7:


Xcode 12.3 is full of issues. Your options are :

  1. Use legacy build system or
  2. Downgrade to 12.2 Not sure how Apple release such a buggy product


来源:https://stackoverflow.com/questions/63267897/building-for-ios-simulator-but-the-linked-framework-framework-was-built

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!