I get an error building the Vapor Project!? Chapter 7

Here is the Error, nothing works with!?

Generating Xcode Project [Failed]
error: terminated(72): xcrun --sdk macosx --find xctest output:

Error: Could not generate Xcode project: error: terminated(72): xcrun --sdk macosx --find xctest output:

I need help I don’t understand it?

I have Xcode 9.4 and Swift 4.2!
Thans for helping me!

@dkoenig82 that looks like a borked Xcode installation - how have you installed Swift 4.2?

What does xcode-select -p show?

I founded out by myself the problem was that not Xcode 9 was selected! But thank you!

2 Likes

I have the same error, hope this isn’t received as thread hacking.
(I do run macOS 12 Beta)

When I run “xcode-select -p” I do get:
/Library/Developer/CommandLineTools

Is this correct?

Kind Regards

This is not correct!

When your Xcode.app is in the Applications Folder, please run this command (to select Xcode):

“sudo xcode-select -s /Applications/Xcode.app/Contents/Developer”

This should work!

6 Likes

Thank you, this almost works. But I now receive this error:

“Could not generate Xcode project: error: root manifest not found”

I guess this has an origin in using the Xcode-beta (10.0). I had the normal version installed but during the Vapor installation it halted because Xcode was not up to date. I had the latest version of Xcode installed so the only version which was newer is the beta. I installed the beta and that made me install Vapor without problems.

@makaha that usually means that you aren’t in the right directory! It’s saying it can’t find the Package.swift.

Just be warned that Vapor and Swift 4.2 aren’t playing too nicely at the moment so you may have issues

1 Like

Ah ok, Will try to find that file. If not then I have to wait or step away from the beta versions :smile:

Guys a really big thank you!

Guys thank you for your support. It was indeed the wrong directory. I did move out of the directory looking if the path was correct, it wasn’t instead of “Xcode” it says “Xcode-beta”. Changed the command to:

“sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer”

But totally forgot that I was no longer in the Vapor Project folder. Sleep isn’t that overrated after all :smile:

1 Like

This worked for me! Thanks a lot :slight_smile:

Even After running

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
this command i am getting the same error

Akshays-MacBook-Air-2:HelloVapor akshaydevkate$ vapor xcode
Generating Xcode Project [Failed]
error: terminated(72): xcrun --sdk macosx --find xctest output:
xcrun: error: unable to find utility “xctest”, not a developer tool or in PATH

Error: Could not generate Xcode project: error: terminated(72): xcrun --sdk macosx --find xctest output:
xcrun: error: unable to find utility “xctest”, not a developer tool or in PATH

Fixed here Server Side Swift with Vapor · Hello World | raywenderlich.com - #11 by akshaydevkate

Hi. It’s working! Thank you very much.