เครื่อง MacBook Pro ปัญหาตอนติดตั้ง Flutter
ตอนใช้คำสั่ง flutter doctor ที่ terminal
ขึ้นข้อความว่า
"xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Doctor summary (to see all details, run flutter doctor -v):
Failed to find the latest git commit date: VersionCheckError: Command exited
with code 1: git -c log.showSignature=false log HEAD -n 1 --pretty=format:%ad
--date=iso
Standard out:
Standard error: xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun"
วิธีแก้ปัญหาคือ
ใช้คำสั่ง
➜ ~ sudo xcode-select --reset
➜ ~ sudo xcode-select --switch /Applications/Xcode.app
➜ ~ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
อ้างอิง
https://stackoverflow.com/questions/32893412/command-line-tools-not-working-os-x-el-capitan-sierra-high-sierra-mojave/32894314#32894314
https://tutorialhorizon.com/tips/xcode-select-error-tool-xcodebuild-requires-xcode-but-active-developer-directory-librarydevelopercommandlinetools-is-a-command-line-tools-instance/