Sorry to resurrect this year old thread, but it's the first result for this error on Google and figured future visitors deserve the command: xcode-select --install. This is sometimes required after macOS upgrades, and resolved this error for me.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: