简体   繁体   English

iOS 模拟器在具有二进制框架的 M1 Mac 上构建失败 - “Swift 5.5.1 编译器无法导入使用 Swift 5.4.2 编译的模块”

[英]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.

相关问题 import FirebaseFirestoreSwift 错误:使用 Swift 5.5.1 编译的模块无法由 Swift 5.6.1 导入 - import FirebaseFirestoreSwift error: Module compiled with Swift 5.5.1 cannot be imported by Swift 5.6.1 Swift 5.0 编译器无法导入使用 Swift 4.2.1 编译的模块 - Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler Swift 4.2.1编译器无法导入使用Swift 4.0.3编译的模块 - Module compiled with Swift 4.0.3 cannot be imported by the Swift 4.2.1 compiler 使用 Swift 5.3.1 编译的模块不能被 Swift 5.1.3 编译器导入 - Module compiled with Swift 5.3.1 cannot be imported by the Swift 5.1.3 compiler 用 Swift 5.3.2 编译的模块不能被 Swift 5.6 编译器导入 - Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.6 compiler 使用 Swift 5.2.4 编译的模块不能被 Swift 5.3.1 编译器导入 - Module compiled with Swift 5.2.4 cannot be imported by the Swift 5.3.1 compiler 使用Swift 4.1.2编译的模块不能由Swift 4.2编译器导入 - Module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 compiler 使用Swift 5.0编译的模块不能由Swift 4.2.1编译器导入 - Module compiled with Swift 5.0 cannot be imported by the Swift 4.2.1 compiler Swift 5.0.1 编译的模块不能被 Swift 5.1 编译器导入 - Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler Swift 5.1编译的模块不能被Swift 5.1.2编译器导入 - Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM