[英]iOS simulator builds fail on M1 Mac with binary framework - "Module compiled with Swift 5.4.2 cannot be imported by the Swift 5.5.1 compiler"
Simulator builds fail in Xcode where a 3rd party framework is being used and that framework is only provided in compiled form.模拟器构建在 Xcode 中失败,其中使用了第 3 方框架并且该框架仅以编译形式提供。
Device builds are successful, but simulator builds on M1 Macs return设备构建成功,但 M1 Mac 上的模拟器构建返回
Module compiled with Swift 5.4.2 cannot be imported by the Swift 5.5.1 compiler
使用 Swift 5.4.2 编译的模块不能被 Swift 5.5.1 编译器导入
The error regarding Swift versions is misleading;关于 Swift 版本的错误具有误导性; as noted in the question, device builds work.
如问题中所述,设备构建工作。 It is only simulator builds that fail.
只有模拟器构建失败。
The actual cause is that the framework was built without an M1 simulator slice and so Xcode cannot complete the simulator build.实际原因是框架是在没有 M1 模拟器切片的情况下构建的,因此 Xcode 无法完成模拟器构建。
The framework supplier needs to supply and updated build that includes both x86 and M1 simulator slices.框架供应商需要提供和更新包含 x86 和 M1 模拟器片的构建。
A work-around is to get Xcode to create X86 simulator builds.一种解决方法是让 Xcode 创建 X86 模拟器构建。
In the Build Settings for your project, specify the x86_64
architecture for iOS simulator builds:在项目的构建设置中,为 iOS 模拟器构建指定
x86_64
架构:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.