68

My Apple MacBook pro M1 2020 automatically updated to Monterey 12.6 recently. With the update, I have to agree with an Xcode agreement/license. After that, I found both python and git are no longer working properly. I got a pop-up saying: The “git” command requires the command line developer tools. But after I installed the tool, the pop-up comes back and ask me to install the tool recursively. Any suggestion to fix the issue?

When I run the git command, I have the following error message:

2022-09-15 16:35:42.216 xcodebuild[5621:29269] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle “IDESimulatorAvailability” couldn’t be loaded.}, dyldError = dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0000): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'
2022-09-15 16:35:42.235 xcodebuild[5621:29269] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot2/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21303/DVTFoundation/PlugInArchitecture/DataModel/DVTPlugIn.m:374
Details:  Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin)
Please ensure Xcode packages are up-to-date — try running 'xcodebuild -runFirstLaunch'.

NSBundle error: Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle “IDESimulatorAvailability” couldn’t be loaded.}
Object:   <DVTPlugIn: 0x600003f1fd40>
Method:   -loadAssertingOnError:error:
Thread:   <_NSMainThread: 0x600001b542c0>{number = 1, name = main}
Hints: 

Backtrace:
  0  0x0000000101c19410
  1  0x0000000101c18aec
  2  0x0000000101c18c6c
  3  0x0000000101ac72ac
  4  0x0000000101a8d118
  5  0x0000000101a8b528
  6  0x00000001bc9701b4
  7  0x00000001bc97f414
  8  0x0000000101c5d58c
  9  0x0000000101c394b0
 10  0x0000000101a8b3c0
 11  0x0000000101a8b5e0
 12  0x0000000102b4f2ec
 13  0x0000000102b4eae0
 14  0x0000000102b4e1e8
 15  0x00000001004ec324
 16  0x000000010027de0c
sh: line 1:  5626 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null
git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)
xcode-select: Failed to locate 'git', requesting installation of command line developer tools.
> putty
dbus[6750]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
r0ng
  • 825
  • 2
  • 7
  • 12
  • You shouldn't rely anyway on OS provided git and python, just better to use your own. You can install newer versions of git using `brew` for example, and Python can be managed by `pyenv` or `asdf`. Doing so allows you to be independent from release/breakages introduced by OS. – Patrick Mevzek Sep 18 '22 at 04:14
  • I was experiencing similar issues and no combination of updating xcode fixed anything for me. What ultimately worked for me was running `sudo xcode-select --reset` – RobertMcReed Sep 19 '22 at 16:27

2 Answers2

134

I ran into the same error yesterday, it took a while to notice that the error itself has the solution :)

Please ensure Xcode packages are up-to-date — try running 'xcodebuild -runFirstLaunch'.

Indeed, running xcodebuild -runFirstLaunch fixed it for me!

Mike San Román
  • 1,386
  • 1
  • 2
  • 4
  • Sadly, this didn't work for me, as brew is still complaining about outdated CLT. I have no admin permissions (work mac) and I am unable to install any utility. Any way I can tell brew to look for the CLT in another non-standard path? – mrbolichi Sep 15 '22 at 15:28
  • 3
    @mrbolichi How did you initiate an update without admin permission? And you're not going to work around this without admin rights. This is a legit reason to contact IT support to get it fixed. – Nelson Sep 15 '22 at 15:52
  • 1
    Works for me, great! – Shafreeck Sea Sep 20 '22 at 10:12
  • This worked flawlessly on my hackintosh that I upgraded from Big Sur to Monterey 12.6 – Florian Wendelborn Sep 25 '22 at 23:24
  • I'm using Monterey, two weeks back I got prompted a license agreement, which is accepted, so there after getting the questioned failure logs but this answer helped me out and worked like a charm. – ArifMustafa Oct 07 '22 at 15:06
  • Thanks for parsing through the error log spam –– I did _not_ see this command, but it works! – Matheus Felipe Oct 11 '22 at 18:48
18

Run

sudo xcode-select --install

You might be prompted to accept a license. Do so.

If you try to run git, you’ll still get an error, run this:

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

Now you should be able to use git.

energee
  • 281
  • 3