Where is Xcode's “TOOLCHAINS” set?

前端 未结 5 401
[愿得一人]
[愿得一人] 2020-12-31 10:27

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:

W         


        
相关标签:
5条回答
  • 2020-12-31 10:52

    I see you have solved the problem by upgrading to 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"

    For those who are using xcrun or xcodebuild tools, I managed to solve it by using an extra option 'toolchain'

    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:

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

    Source: https://marc.ttias.be/swift-users/2016-08/msg00188.php

    0 讨论(0)
  • 2020-12-31 10:52

    Toolchains is not explicitly called out as it was in the prior builds. However, it is still there in the Locations -> Command Line Tools portion of the Xcode Preferences menu

    Choosing Xcode 8 resolved the issue for me.

    0 讨论(0)
  • 2020-12-31 10:57

    I had the same warning and i could solve the problem by cleaning the build folder (alt+shift+cmd+K)

    0 讨论(0)
  • 2020-12-31 11:06

    If you don't have "Toolchain" option under XCode menu, you need to download and install a snapshot or release first.

    0 讨论(0)
  • 2020-12-31 11:06

    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.

    0 讨论(0)
提交回复
热议问题