Converting to Swift 3 error: “Convert to Current S

2020-03-02 04:26发布

问题:

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) 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.

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

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)

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

回答1:

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 .

Build again and it will work fine .