ios - 不支持的 Swift 版本

标签 ios swift swift3 swift2 xcode9-beta5

我正在关注 this tutorial并试图获得 starter project运行。当我打开项目时,我看到了这些警告:

Unsupported Swift Version
The target “SocketChat” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets.

Use Xcode 8.x to migrate the code to Swift 3.

在运行这个程序时停止执行,我得到这个错误

Dependency Analysis Error Group
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

我正在使用 Xcode 9 beta。我该如何解决这个问题并让项目运行?

最佳答案

您的项目可能有 swift 2.0swift 2.1swift 2.2 版本,因此 Xcode 9 或更高版本不支持那个版本。而且它也不能将 swift 2.x 的语法转换为 swift 4

请记住,xcode 9 或更高版本默认具有 swift 4 版本。

Xcode 8 8.1、8.2 或 8.3 中打开此项目,您的项目将成功运行。

关于ios - 不支持的 Swift 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46080657/

相关文章:

ios - 有效负载安装顺序是否未定义?

iOS 心率检测算法

android - 在 react native 应用程序中从 native 基础实现抽屉

ios - 如何获得在作为 UIImageView 的 subview 的 UIView 层中绘制的形状的不透明度?

ios - Swift 3 项目中的 Unity 实现:应用程序启动时崩溃 - MetadataCache::Initialize()

ios - 我正在尝试在 XCode 中修复我的引脚,但在 XCode8.2.1 中没有获取更新帧按钮

iphone - 将组件添加到路径 - Objective C

swift - 不停顿地播放视频(Swift)

ios - Swift - 动画 UIImageView 图像

swift - Swift 2.0新的'执行更改'PHPPhotoLibrary将无法正常工作