When trying to build Vapor 0.13 (and likely other versions) w/ Swift 3 and 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'
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.
Execute the following steps
DEVELOPMENT-SNAPSHOT-06-20-A
here
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.
This will tell your system to use the Xcode-beta tools which support latest Swift
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
Return to your project and Verify that your project specifies Vapor 0.13
, it will look like this:
.Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0, minor: 13),
Build your Xcode project
swift package generate-xcodeproj
Completely quit Xcode 7 if it is running
Open Xcode project with open *.xcodeproj
Verify the project was opened with Xcode 8
Select toolchain Xcode > Toolchains > DEVELOPMENT-SNAPSHOT-06-20-A
Run project 🚀
If you have any more questions, checkout the #help channel in our slack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With