I solved the problem by reinstalling /Library/Developer/CommandLineTools.
/Library/Developer/CommandLineTools