According to this thread, the solution is to check wether the path to Xcode contains a space.
https://developer.apple.com/forums/thread/734638
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: