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

查看:135
本文介绍了转换为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


使用旧版Swift语言必须为使用Swift的目标正确配置
版本(SWIFT_VERSION)。使用[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 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天全站免登陆