Xcode 的“TOOLCHAINS”设置在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39884323/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is Xcode's "TOOLCHAINS" set?
提问by J. Cocoe
I upgraded my project from Swift 2.2 to 2.3 (Xcode 7 to 8), and committed everything on one Mac. When I pulled from git on my other Mac, and built, I get:
我将我的项目从 Swift 2.2 升级到 2.3(Xcode 7 到 8),并在一台 Mac 上提交了所有内容。当我在另一台 Mac 上从 git 中提取并构建时,我得到:
Warning: target specifies SWIFT_VERSION = '2.3', but it is overridden by TOOLCHAINS = 'com.apple.dt.toolchain.XcodeDefault'
I can't find anything called "TOOLCHAINS" in any file. What's this warning mean?
我在任何文件中都找不到任何名为“TOOLCHAINS”的东西。这个警告是什么意思?
回答by Areal-17
I had the same warning and i could solve the problem by cleaning the build folder (alt+shift+cmd+K)
我有同样的警告,我可以通过清理构建文件夹(alt+shift+cmd+K)来解决问题
回答by Youri Nooijen
I see you have solved the problem by upgrading to Swift 3.0.
我看到你已经通过升级到 Swift 3.0 解决了这个问题。
I encountered the same problem, and did some research in this. When building within Xcode, make sure you have the setting " Project > Build Settings > Use Legacy Swift Language Version"set to "Yes"
我遇到了同样的问题,并在这方面做了一些研究。在 Xcode 中构建时,请确保将“项目 > 构建设置 > 使用旧 Swift 语言版本”设置为 “是”
For those who are using xcrunor xcodebuildtools, I managed to solve it by using an extra option 'toolchain'
对于那些使用xcrun或xcodebuild工具的人,我设法通过使用一个额外的选项“工具链”来解决它
xcrun --toolchain "com.apple.dt.toolchain.Swift_2_3"
xcodebuild -toolchain "com.apple.dt.toolchain.Swift_2_3"
The identifier "com.apple.dt.toolchain.Swift_2_3"can be found at:
可以在以下位置找到标识符“com.apple.dt.toolchain.Swift_2_3”:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/ToolchainInfo.plist
Hope this helps for those who are developing in Swift 2.3.
希望这对那些在 Swift 2.3 中进行开发的人有所帮助。
Source: https://marc.ttias.be/swift-users/2016-08/msg00188.php
资料来源:https: //marc.ttias.be/swift-users/2016-08/msg00188.php
回答by MobileVet
Toolchains is not explicitly called out as it was in the prior builds. However, it is still there in the Locations-> Command Line Toolsportion of the Xcode Preferencesmenu
工具链没有像之前的版本那样被明确调用。但是,它仍然存在于Xcode Preferences菜单的Locations-> Command Line Tools部分
Choosing Xcode 8resolved the issue for me.
选择Xcode 8为我解决了这个问题。
回答by Andrey Volobuev
回答by Jeffrey Bergier
Toolchains are set under the Xcode menu then Toolchains. It should be set to Xcode 8. There is also a build setting in Xcode 8 called "Use legacy swift version" that should be set to YES so that you use Swift 2.3 instead of 3.
工具链在 Xcode 菜单下设置,然后是工具链。它应该设置为 Xcode 8。 Xcode 8 中还有一个名为“Use legacy swift version”的构建设置,它应该设置为 YES,以便您使用 Swift 2.3 而不是 3。