22

I can no longer build Qt project after updating to Xcode 8 today. I get the following error despite having followed the instructions from this answer.

Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.

How to fix it?

Community
  • 1
  • 1
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
  • Possible duplicate of [Qt Creator - Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild](http://stackoverflow.com/questions/33728905/qt-creator-project-error-xcode-not-set-up-properly-you-may-need-to-confirm-t) – 123 Dec 23 '16 at 23:43

3 Answers3

40

A cleaner solution

cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun

Update 2023: If you get ln: xcrun: Operation not permitted

Settings -> Privacy and Security -> App Managements -> Terminal to ON

Daniel Georgiev
  • 1,292
  • 16
  • 14
39

I managed to get capybara-webkit (which uses QT) built with XCode 8 / MacOX Sierra after following these instructions (found here: https://forum.qt.io/topic/71119/project-error-xcode-not-set-up-properly/7)

  1. Move to the folder where you install Qt.
  2. Open in a text editor the file at Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
  3. Find the line with text (for me it was line 15):

    isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null")))): \
    

    Replace line with:

    isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
    
  4. Save & re-compile

Whatcould
  • 793
  • 6
  • 6
  • I tried equivalent for iOS. Must I upgrade from **El Capitan 10.11.6** to **macOS** ? I am getting **Project ERROR: Current iphoneos SDK version (10.0) is too old. Please upgrade Xcode.** – Ed of the Mountain Sep 20 '16 at 18:11
  • 4
    On my Mac I found the same file at the following location: `qt_install_folder/4.8.7_2/mkspecs/features/mac/default_pre.prf` – sinner Sep 20 '16 at 18:35
  • 2
    It works with QT5.5 installed with brew, same issue with capybara-webkit – heberuriegas Oct 06 '16 at 19:00
  • 2
    Same issue here for iOS builds but instead of entering "clang_64" I had enter "ios" instead (Rest of the path the same) and edit the "default_pre.prf " file. – Placeable Oct 26 '16 at 12:29
  • step 2. `[Qt_install_folder]/[Qt_version(/clang_64||)/mkspecs/features/mac/default_pre.prf` – AndreiMotinga Oct 31 '16 at 15:04
  • This seemed to get QT5.5 + Mojave + capybara-webkit built. – Sam Lehman Jun 04 '19 at 20:08
  • This answer depends on your qt version. I found the problem line in `qtbase/configure` on qt 5.3.2, made the change, and got past the issue. – NuclearPeon Feb 15 '20 at 20:29
0

Run MaintenanceTool in Qt directory and update to version 5.8

Sergei Krivonos
  • 4,217
  • 3
  • 39
  • 54