转换为 Swift 3 错误:“转换为当前 Swift 语法失败无法找到测试主机..." [英] Converting to Swift 3 error: "Convert to Current Swift Syntax Failed Could not find test host for..."

查看:28
本文介绍了转换为 Swift 3 错误:“转换为当前 Swift 语法失败无法找到测试主机..."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在升级到 Xcode 8 之前运行完美运行的项目时,我不断收到错误

When I try to run my project that ran perfectly before upgrading to Xcode 8 I keep getting the error

Use Legacy Swift Language Version" (SWIFT_VERSION) 是必需的为使用 Swift 的目标正确配置.使用 菜单选择一个 Swift 版本或使用构建设置编辑器直接配置构建设置.

"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 3.0 后,我不断收到错误:

After trying to convert to swift 3.0 i continually get the error:

转换为当前 Swift 语法失败找不到测试主机CastleTests:TEST_HOST 评估为:(我的项目和测试文件夹的文件位置)

Convert to Current Swift Syntax Failed Could not find test host for CastleTests: TEST_HOST evaluates to: (location of my file for my project and test folders)

我尝试将另一个项目转换为 swift 3,它运行得非常好,但这个不起作用.产品的所有位置都设置为与工作项目中的位置相同我不明白为什么我不断收到此错误

I've tried converting another project to swift 3 and it worked perfectly fine, but this one will not work. All of the locations of the products are set up the same as how the ones in the working project are I'm confused to why i keep getting this error

推荐答案

i)在项目中选择测试的每个目标.ii) 导航到常规"选项卡.iii) 主机应用程序名称,因此使用适当的主机名称进行更新.

i)Select every target of Test in Project. ii)Navigate to General tab. iii)Host application name is empty ,so Update with appropriate host name .

重新构建,它会正常工作.

这篇关于转换为 Swift 3 错误:“转换为当前 Swift 语法失败无法找到测试主机..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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