Monterey 12.6 The "git" command requires the command line developer tools.が何回も出てくる
突然The "git" command requires the command line developer tools.と出てくるようになった.
環境
- MacOS Monterey 12.6
- MacBook Air(M1, 2020)
TL;DR;
タイムリーに情報があった.
参考文献内のソース forums.unrealengine.com
解決前の状態と解決法
解決前の状態(Installを押して完了しても何回も出てくる)
解決前にgitコマンドを叩いたときの出力.
Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[DVTPlugIn plugInManager] (in DVTFoundation) 4 -[DVTExtension _fireExtensionFaultAssertingOnError:error:] (in DVTFoundation) 5 __80-[DVTExtension _valueForKey:inParameterData:usingSchema:assertingOnError:error:]_block_invoke (in DVTFoundation) 6 _dispatch_client_callout (in libdispatch.dylib) 7 _dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib) 8 DVTDispatchBarrierSync (in DVTFoundation) 9 -[DVTDispatchLock performLockedBlock:] (in DVTFoundation) 10 -[DVTExtension _valueForKey:inParameterData:usingSchema:assertingOnError:error:] (in DVTFoundation) 11 -[DVTExtension valueForKey:] (in DVTFoundation) 12 _IDEInitializeOnePlugInAndPrerequisites (in IDEFoundation) 13 _IDEInitializePlugIns (in IDEFoundation) 14 IDEInitialize (in IDEFoundation) 15 -[Xcode3CommandLineBuildTool run] (in Xcode3Core) 16 XcodeBuildMain (in libxcodebuildLoader.dylib) 17 start (in dyld) sh: line 1: 3561 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.
解決策として,Qiitaにならって以下を実行した.
$ xcodebuild -runFirstLaunch Install Started 1%.........20.........40.........60.........80........Install Succeeded
すると,問題なく動いた.