Xcode 9:使用Swift 3.1编译的模块无法在Swift 4.0中导入 [英] Xcode 9 : Module compiled with Swift 3.1 cannot be imported in Swift 4.0
问题描述
更新到Xcode 9之后,我尝试构建我的一个项目。
After updating to Xcode 9, I tried to build one of my projects.
我使用 FacebookLogin 窗格。
我在FacebookLogin / LoginButton.swift中有编译器错误
I use the FacebookLogin pod. I have a compiler error in FacebookLogin/LoginButton.swift
@testable import FacebookCore
❌ Module compiled with Swift 3.1 cannot be imported in Swift 4.0
在我的目标的构建设置中,设置了Swift语言版本 Swift 3.2 。
In my target's build settings, the Swift language version is set to Swift 3.2.
我想我需要等待Facebook更新他们的pod?还是其他任何建议?
I guess I need to wait for Facebook to update their pod ? Or any other suggestion ?
谢谢!
推荐答案
我想要要补充一点,如果您使用 Carthage 在Swift 3.2中编译模块,您应该去终端并运行:
I would like to add that if you are using Carthage to compile a module in Swift 3.2 you should go to a terminal and run:
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
要使用Xcode 9命令行工具,您可以运行:
To use the Xcode 9 command line tools, then you can run:
carthage update NameOfTheLibrary --platform iOS --no-use-binaries
这将使用您当前的命令行工具编译库,它可以是有点慢,但现在项目应该建立。
This will compile the library with your current command line tools, it can be a bit slow but now the project should build.
注意
要恢复和使用您的稳定Xcode命令行工具只需运行:
To revert and use your stable Xcode command line tools simply run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
这篇关于Xcode 9:使用Swift 3.1编译的模块无法在Swift 4.0中导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!