Module compiled with Swift xxx cannot be imported by the Swift xxx compiler

54 篇文章 1 订阅

Module compiled with Swift xxx cannot be imported by the Swift xxx compiler

原因

今天升级xcode 12.2最新版,然后编译出现下面错误。
Module compiled with Swift 5.3 cannot be imported by the Swift 5.3.1 compiler: /Users/tdw/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/SwiftyJSON/SwiftyJSON.swiftmodule/armv7-apple-ios.swiftmodule

翻译过来就是 之前的模块用的swift5.3编译的。不能被5.31的编译器import导入.
错误原因是:老得swift模块,不能被最新的xcode使用。

解决方法:

到swift官方下载一个工具
Toolchain
https://swift.org/download/#releases
选择 xcode 12.2我当前的版本
在这里插入图片描述
下载完以后安装swift-5.3.1-RELEASE-osx.pkg
文件很大753M,可以右键复制链接,然后用迅雷下载
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
安装完以后在xcode里面左上角点击xcode菜单打开能找到Toolchains
选择xcode12.2。你下载以后选择最新版本就行,再编译就不会报错了

在这里插入图片描述

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值