无法在 Swift 3.0.1 中导入使用 swift 3.0 编译的模块 [英] Module compiled with swift 3.0 cannot be imported in Swift 3.0.1

查看:27
本文介绍了无法在 Swift 3.0.1 中导入使用 swift 3.0 编译的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Xcode 升级到 8.1 GM,现在出现以下 SwiftyJSON 错误.其他导入的框架似乎有效.有没有办法强制它在 Swift 3 中工作,直到 SwiftyJSON 升级他们的框架?我使用 Carthage 导入/更新框架.我还尝试更改 Use Legacy Swift language version On 和 Off 无济于事.

I upgraded Xcode to 8.1 GM and am now getting the below error for SwiftyJSON. Other imported frameworks seem to work. Is there a way to force this to work in Swift 3 until SwiftyJSON upgrades their framework? I used Carthage to import/update frameworks. I also tried changing Use Legacy Swift language version On and Off to no avail.

使用 Swift 3.0 编译的模块无法在 Swift 3.0.1 中导入:模块/SwiftyJSON.swiftmodule/arm64.swiftmodule

Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1: Modules/SwiftyJSON.swiftmodule/arm64.swiftmodule

推荐答案

SwiftyJson 正在下载由 carthage 预编译.预编译下载是 Swift 3.0 版.这让编译器抱怨版本不正确.使用以下命令:

SwiftyJson is being downloaded precompiled by carthage. The precompiled download is with Swift Version 3.0. That makes the compiler complain that the version is not correct. Using the following command:

carthage update --platform iOS --no-use-binaries

SwiftyJson(以及 Carthage 中的所有其他框架)将使用本地版本的 Swift (3.0.1) 在本地编译,编译器将不再抱怨.

SwiftyJson (and all other frameworks within Carthage) will be compiled locally using the local version of Swift (3.0.1) and the compiler will not complain anymore.

这篇关于无法在 Swift 3.0.1 中导入使用 swift 3.0 编译的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆