Homebrew thinks Xcode CLT aren't installed

Sometimes I get this message.

The bottle needs the Xcode CLT to be installed.

That’s weird because I’m running Xcode 10 on MacOS Mojave and CLT are installed. I found instructions for installing Xcode CLT so I tried that.

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

I’m not sure what it means by “Software Update”. I definitely have the latest release of Xcode 10.

Xcode is convinced that CLT is installed.

brew config can find some of the tools like clang and git but not CLT.

$ brew config
HOMEBREW_VERSION: 1.7.6-22-gdae4791
ORIGIN: https://github.com/Homebrew/brew
HEAD: dae47914ca383e0ed5192436b9e7e11e0bf2640e
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f3d5acb04536344cb10a844e639fc4f73c3bbe72
Core tap last commit: 9 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.3.7 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_25, 1.6.0_65-b14-468
macOS: 10.14-x86_64
CLT: N/A
Xcode: 10.0
XQuartz: 2.7.11 => /opt/X11

brew doctor told me that I should update CLT from the App Store.

Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store.

There aren’t any updates available in the App Store because I have the latest!

Any ideas?

This looks like a bug, could you file it at https://github.com/homebrew/brew? (If nobody did already)

Done!

Hi, I Have the same problem! How u done it?

I’m sorry but I don’t know. I think the problem just solved itself. It was a long time ago!

I write for everyone who also came across this thread in search of answers. I solved this problem as follows:
Installed the corresponding version of my Xcode command line tool from the official site:
https://developer.apple.com/download/more/?=command%20line%20tools

Then I used brew upgrade and everything was solved. Please note that in the latest versions of Xcode, CLT cannot be installed directly from Xcode.