Git: Error: Unable to read SDK settings for MacOSX.sdk

GitTerminalMacos Mojave

Git Problem Overview


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.

Git Solutions


Solution 1 - Git

CommandLineTools is outdated. The below should fix it.

xcode-select --install

Solution 2 - Git

I had to do the following to resolve:

xcode-select --install

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

Solution 3 - Git

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.

Solution 4 - Git

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

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPrajnaranjan DasView Question on Stackoverflow
Solution 1 - GitNayan BhanaView Answer on Stackoverflow
Solution 2 - Gituser7856874View Answer on Stackoverflow
Solution 3 - GitbenhorgenView Answer on Stackoverflow
Solution 4 - GitAbdul Karim KhanView Answer on Stackoverflow