9

I'm trying to install the latest version of Qt for mac (https://www.qt.io/). But when I try to install I get an error.

You need to install Xcode http://developer.apple.com/xcode. If already installed, then set active developer directory with ‘xcode-select’.

I've now installed xcode 7.3.1, and then ran the following in terminal:

sudo xcode-select -switch /Applications/Xcode.app

But I'm still running into the same error (see screenshot).

enter image description here

Can anyone advise how I might troubleshoot this?

tim_xyz
  • 11,573
  • 17
  • 52
  • 97
  • Possible duplicate of [xcode-select active developer directory error](http://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error) – JAL Nov 02 '16 at 21:41

3 Answers3

25

This fixed my error.

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

It came from the answer here. https://stackoverflow.com/a/17980786/2009221

The first time I clicked OK the error reappeared. The second time it was accepted and the installation continued.

Community
  • 1
  • 1
cstarcher
  • 353
  • 4
  • 10
0

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer did not work for me as xcode-select still marked the directory as invalid. I created a symlink to homebrew's internal target xcode dev tools directory via:

sudo ln -s /Applications/Xcode.app/Contents/Developer /Library/Developer/CommandLineTools

Reinstalling homebrew after creating the above symlink worked for me.

A-Dubb
  • 1,670
  • 2
  • 17
  • 22
  • This is as of August, 2018 Kernel: Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64 – A-Dubb Nov 01 '18 at 18:57
-4

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

rich
  • 1
  • this is exactly the same answer as posted earler: https://stackoverflow.com/a/40390272/578411 and that one is considerably better. Please add some substance and if you can't refrain from answering. – rene Aug 12 '17 at 09:42