62

Error while adding in git after updating to new OS Mojave

Error

git: error: unable to read SDK settings for '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

Error faced in:

  • Device: MacBook Pro (Retina, 13-inch, Early 2013)
  • OS: MacOS Mojave

Screenshot Screen Shot of Terminal

Question

How to solve this error ?

Anyones help will be really appriciated.

Prajnaranjan Das
  • 1,378
  • 1
  • 9
  • 26

4 Answers4

128

CommandLineTools is outdated. The below should fix it.

xcode-select --install
Nayan Bhana
  • 1,314
  • 1
  • 9
  • 4
  • 4
    It worked for me. So I'm upvoting. Mojave on MBP 15 2017 using iTerm. – Lucio Mollinedo Oct 12 '18 at 19:44
  • I wish it could work, but I need to download the Command Line Tools, because the problem Can't install the software because it is not currently available from the Software Update server. Then I refer to the link(https://stackoverflow.com/questions/19907576/xcode-is-not-currently-available-from-the-software-update-server) found the update. But There isn't Command Line Tools(macOS 10.14) for Xcode 9.4.1 – 冯剑龙 Nov 05 '18 at 07:04
  • 1
    worked for me too, should be default for xcode. how often did we already did this in the past and how often will we doing this... thx for the answer/reminder – kemuri Jan 06 '19 at 17:32
1

I had to do the following to resolve:

xcode-select --install

sudo xcode-select -switch /Library/Developer/CommandLineTools
0

Since I had just updated Xcode (using the AppStore) I had to open Xcode and let the installer finish some configuration work before Visual Studio for Mac would successfully compile my Android application again.

I thought this was weird because my solution did not include any projects targeting iOS. The solution contained just a few .NET Core library projects and an Android APK.

I also had to run the 'xcode-select --install' command.

benhorgen
  • 1,928
  • 1
  • 33
  • 38
0

You can simply go to Xcode Preferences > Locations > Command Line Tools > Select latest Xcode version

enter image description here

Abdul Karim Khan
  • 4,256
  • 1
  • 26
  • 30