需要为使用Swift的目标正确配置“使用旧版Swift语言版本”(SWIFT_VERSION)。 [英] “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift."

查看:248
本文介绍了需要为使用Swift的目标正确配置“使用旧版Swift语言版本”(SWIFT_VERSION)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我更新到Xcode 8.2(来自App Store的GM种子)以来,我一直陷于以下错误:

Ever since I've updated to Xcode 8.2 (GM seed, from the App Store), I have been stuck at the following error:


使用旧版Swift语言版本(SWIFT_VERSION)必须为使用Swift的目标正确配置
。使用[Edit>
Convert> To Current Swift Syntax…]菜单选择一个Swift版本,或者
使用Build Settings编辑器直接配置构建设置。

Use Legacy Swift Language Version" (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

所以我转到目标的构建设置,并搜索了 SWIFT_VERSION ,看看我在哪里犯错。但是,我很惊讶地发现它已经设置为

So I went to my target's Build Settings, and searched for SWIFT_VERSION to see where I was erring. However, I was surprised to find that it was already set to No!

我该如何解决?

推荐答案

Xcode 8似乎错误地显示了一个不存在的(幻像,如果可以的话) 。有一个简单的解决方法:

Xcode 8 seems to be wrongfully displaying a nonexistent ("phantom", if you will) No. There's a trivial fix for this:


  1. 点击 SWIFT_VERSION 来切换下拉列表。

  2. 设置 Debug 的值和 发布

  3. 设置 Debug Release 返回

  1. Click the tiny arrow next to SWIFT_VERSION to toggle the drop-down list.
  2. Set the values for Debug and Release to Yes.
  3. Set the values for Debug and Release back to No.

下图是在将 Debug 设置为 之后拍摄的>。 Xcode显示 Debug Release 均设置为 ,但是 SWIFT_VERSION 读取的是<多个值>

The image below was taken just after setting Debug to No. Xcode shows that both Debug and Release are set to No, however SWIFT_VERSION reads <Multiple Values>:

由此,我只能得出结论,这是一个错误;并且某些值(或更可能是空值)被错误地表示为 No

From this, I can only conclude that it is a bug; and that some value (or more probably a null value) is being misrepresented as No.

这篇关于需要为使用Swift的目标正确配置“使用旧版Swift语言版本”(SWIFT_VERSION)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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