Just thought I’d share if you’re experiencing the same issue.
I was running macOS Sierra with XCode 9, the simple fix is to update to macOS High Sierra and XCode 10.
If you search the mac app store for macOS High Sierra, you won’t find it, here’s the direct link to it: macappstores://itunes.apple.com/app/id1246284741
Just update your XCode from the mac app store as usual or download it from the Apple developer portal.
Extra: How to make a bootable drive if you’ve got multiple machines to update: https://www.macworld.co.uk/how-to/mac-software/bootable-mac-install-drive-3575875