I was having the same issue.
I managed to get it fixed by running
sudo xcode-select -switch /Library/Developer/CommandLineTools
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: