git error "unable to locate xcodebuild" after a fresh OS X Mavericks upgrade

GitXcodebuildOsx Mavericks

Git Problem Overview


When I try to run previously working git commands, I get this:

dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

How can I fix this?

Git Solutions


Solution 1 - Git

This works for me sudo xcode-select --switch /Library/Developer/CommandLineTools/

Solution 2 - Git

After a much googling and confusion, the following steps lead to a solution (with Xcode installed). Some might be optional, so please feel free to elaborate on this as I am not an expert on these errors.

  • download mavericks command line tools https://developer.apple.com/downloads/
  • xcode-select --install
  • sudo xcode-select -switch /Library/Developer/CommandLineTools
  • brew install sqlite3
  • commented out DYLD_LIBRARY_PATH entry in my .bashrc file

Solution 3 - Git

On MacOS Mojave this worked for me (git 2.21.0):

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

Solution 4 - Git

If you have already installed Xcode, you can run the following command to determine and point to the correct location

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

Or use AppStore to install latest Xcode.

Solution 5 - Git

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

This did it for me.

Solution 6 - Git

Most likely you need to reinstall the command line tools before switching the xcode path to point there.

First install the tools

$ xcode-select --install

This will install the tools into the folder /Library/Developer/CommandLineTools.

Then point the xcode path to where the tools were installed, like this

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

Note: You can see the current xcode path with the command $ xcode-select -p. Mine was initially pointing to /Applications/Xcode.app/Contents/Developer when I was getting the error

Solution 7 - Git

This worked for me in MacOS High Sierra (10.13.6)

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

Solution 8 - Git

I met this error when i run the command 'git clone xxx'

dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild Reason: image not found git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly! git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

Then, run the command

xcode-select -p

pointing to /Applications/Xcode.app/Contents/Developer

After run the command sudo xcode-select -switch /Library/Developer/CommandLineTools

it points to /Library/Developer/CommandLineTools

Solution 9 - Git

I hit this same issue running Fastlane on a fresh High Sierra installation. Solved with:

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

Solution 10 - Git

Maybe you should install Xcode 5.0.1 for Mavericks. Check updates.

Solution 11 - Git

This worked for me, just paste in terminal: sudo xcode-select --switch /Library/Developer/CommandLineTools/

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
Questiontol4trobView Question on Stackoverflow
Solution 1 - GitsushilprjView Answer on Stackoverflow
Solution 2 - Gittol4trobView Answer on Stackoverflow
Solution 3 - GittheandrewlaneView Answer on Stackoverflow
Solution 4 - GitzdkView Answer on Stackoverflow
Solution 5 - GitaregjanView Answer on Stackoverflow
Solution 6 - GitanswerzillaView Answer on Stackoverflow
Solution 7 - GitJ KnowlesView Answer on Stackoverflow
Solution 8 - GitNANAView Answer on Stackoverflow
Solution 9 - GitwantonView Answer on Stackoverflow
Solution 10 - GittonView Answer on Stackoverflow
Solution 11 - GitKalena GalarnykView Answer on Stackoverflow