">swift build" fails, I don't understand why.

I installed the latest Xcode : v10 (10A255) on macOS Mojave v10.14 (18A391)


> swift --version
Apple Swift version 4.2 (swiftlang-1000.0.37.1 clang-1000.10.44)


> swift build

used to build my project (which uses other packages)

but now I get:


> swift build
error: terminated(72): xcrun --sdk macosx --find xctest output:

I'm not trimming anything here; there's nothing after "output:" the following line is empty.


I can create a new package "swift init --type executable"; but I'll have the same error if I try to build it.


I can't tell what's wrong here and my internet search is unfruitful so far.

Accepted Reply

Listing my findings to any future reader:


$ xcode-select -p
/Library/Developer/CommandLineTools

I tried:


$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates


$ xcode-select --reset


$ swift build

properly compiled the package.

Replies

Did you do a Clean Build Folder ?

When I tried making the new package, there would not have been any existing previous build history/folder.

Listing my findings to any future reader:


$ xcode-select -p
/Library/Developer/CommandLineTools

I tried:


$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates


$ xcode-select --reset


$ swift build

properly compiled the package.

This is still not working for me. i've installed xcode from the appstore still i'm getting the same error, can you please let me know all the steps?