Building for iOS, but the linked and embedded framework ‘x.framework’ was for iOS + iOSSimulator

完美起航-升级XCode12.3报错Buildingfor,butthelinkedandembeddedframeworkwasbuiltforiOS+iOSSimulator

一、报错

  • 报错内容大致如下

/xxxx/xxx.xcodeproj Building for iOS, but the linked and embedded framework ‘xxx.framework’ was built for iOS + iOS Simulator.
诸如此类,可能有些许不同

二、原因

  • WWDC 2019 推出 XCFramework 启,其实 XCode 11 开始就会有这个问题,但在 XCode 11 上一直是 warning 也就没太注意
  • XCode12.3 开始,针对类似于 iOS + iOS Simulator 这种多平台的包,强制使用 XCFramework 架构,否则 error( 好坑啊 )

三、解决

  • 这里提供三套方案,前两套比较简单,修改主项目配置即可;第三套是 Apple建议的方法,也就是重新打包 framework 为 XCFramework

3.1 Validate WorkSpace

  • 启用 Validate WorkSpace ,让 XCode 对 frameworks 进行自动化管理

  • 打开项目路径 - Build Setting > Build Options > Validate WorkSpace

3.3 是 Apple建议的方法 ,建议改成xcframework。

The framework isn't built with a supported configuration -- iOS and iOS Simulator should never appear in the same binary. You should follow-up with the support channel for the framework vendor and see if they have a fixed version (which needs to be a XCFramework).

Embedded frameworks architectures … | Apple Developer Forums

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值