Web框架:错误:Swift不支持SDK 'MacOSX10.11.sdk'

时间:2023-01-24 00:03:03

When trying to build Vapor 0.13 (and likely other versions) w/ Swift 3 and Xcode

当尝试构建蒸汽0.13(可能还有其他版本)w/ Swift 3和Xcode时

Environment

环境

Vapor: 0.13
Swift: 3
Snapshot: DEVELOPMENT-SNAPSHOT-06-20-A
Xcode: 8

The following error is often the first result:

下面的错误通常是第一个结果:

error: Swift does not support the SDK 'MacOSX10.11.sdk'

错误:Swift不支持SDK 'MacOSX10.11.sdk'

1 个解决方案

#1


9  

NOTE: This is a Q&A Question that is being answered by the author.

注意:这是作者正在回答的问题。

This is an issue of having Xcode 7 already installed, and the latest snapshot being unable to run properly.

这是已经安装了Xcode 7的问题,最新的快照无法正常运行。

Execute the following steps

执行以下步骤

  1. Completely open Xcode 8 and install additional components as prompted
  2. 完全打开Xcode 8并按提示安装其他组件
  3. Make sure you've downloaded DEVELOPMENT-SNAPSHOT-06-20-A here
  4. 确保你已经在这里下载了开发- snapshot -06-20- a
  5. Run the following command

    运行以下命令

    sudo xcode-select -s /Applications/Xcode-beta.app/
    

    or go to Xcode preferences, then to the Locations tab and setting the "Command Line Tools" popup to Xcode 8.0.

    或者转到Xcode preferences,然后转到Locations选项卡,并将“命令行工具”弹出到Xcode 8.0。

    This will tell your system to use the Xcode-beta tools which support latest Swift

    这将告诉您的系统使用支持最新Swift的Xcode-beta工具。

    Note: In above example, Xcode-beta is expected to be the name of your beta. If you change the names to something like Xcode-beta2, replace above. In occasional situations, users have had to do -s /Applications/Xcode-beta.app/Contents/Developer

    注意:在上面的示例中,Xcode-beta应该是beta的名称。如果将名称更改为Xcode-beta2,请在上面进行替换。在偶然的情况下,用户不得不做-s /应用程序/Xcode-beta.app/内容/开发人员

  6. Return to your project and Verify that your project specifies Vapor 0.13, it will look like this:

    返回到您的项目并验证您的项目指定了蒸气0.13,它将如下所示:

    .Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0, minor: 13),
    
  7. Build your Xcode project

    建立你的Xcode项目

    swift package generate-xcodeproj
    
  8. Completely quit Xcode 7 if it is running

    如果Xcode 7正在运行,请完全退出

  9. Open Xcode project with open *.xcodeproj

    使用Open *.xcodeproj打开Xcode项目

  10. Verify the project was opened with Xcode 8

    验证项目是用Xcode 8打开的

  11. Select toolchain Xcode > Toolchains > DEVELOPMENT-SNAPSHOT-06-20-A

    选择工具链Xcode >工具链>开发- snapshot -06-20- a。

  12. Run project ????

    运行项目????

If you have any more questions, checkout the #help channel in our slack.

如果您还有任何问题,请查看我们的slack中的#help通道。

#1


9  

NOTE: This is a Q&A Question that is being answered by the author.

注意:这是作者正在回答的问题。

This is an issue of having Xcode 7 already installed, and the latest snapshot being unable to run properly.

这是已经安装了Xcode 7的问题,最新的快照无法正常运行。

Execute the following steps

执行以下步骤

  1. Completely open Xcode 8 and install additional components as prompted
  2. 完全打开Xcode 8并按提示安装其他组件
  3. Make sure you've downloaded DEVELOPMENT-SNAPSHOT-06-20-A here
  4. 确保你已经在这里下载了开发- snapshot -06-20- a
  5. Run the following command

    运行以下命令

    sudo xcode-select -s /Applications/Xcode-beta.app/
    

    or go to Xcode preferences, then to the Locations tab and setting the "Command Line Tools" popup to Xcode 8.0.

    或者转到Xcode preferences,然后转到Locations选项卡,并将“命令行工具”弹出到Xcode 8.0。

    This will tell your system to use the Xcode-beta tools which support latest Swift

    这将告诉您的系统使用支持最新Swift的Xcode-beta工具。

    Note: In above example, Xcode-beta is expected to be the name of your beta. If you change the names to something like Xcode-beta2, replace above. In occasional situations, users have had to do -s /Applications/Xcode-beta.app/Contents/Developer

    注意:在上面的示例中,Xcode-beta应该是beta的名称。如果将名称更改为Xcode-beta2,请在上面进行替换。在偶然的情况下,用户不得不做-s /应用程序/Xcode-beta.app/内容/开发人员

  6. Return to your project and Verify that your project specifies Vapor 0.13, it will look like this:

    返回到您的项目并验证您的项目指定了蒸气0.13,它将如下所示:

    .Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0, minor: 13),
    
  7. Build your Xcode project

    建立你的Xcode项目

    swift package generate-xcodeproj
    
  8. Completely quit Xcode 7 if it is running

    如果Xcode 7正在运行,请完全退出

  9. Open Xcode project with open *.xcodeproj

    使用Open *.xcodeproj打开Xcode项目

  10. Verify the project was opened with Xcode 8

    验证项目是用Xcode 8打开的

  11. Select toolchain Xcode > Toolchains > DEVELOPMENT-SNAPSHOT-06-20-A

    选择工具链Xcode >工具链>开发- snapshot -06-20- a。

  12. Run project ????

    运行项目????

If you have any more questions, checkout the #help channel in our slack.

如果您还有任何问题,请查看我们的slack中的#help通道。