Turns out there’s a setting in Xcode’s preferences under Locations which needs to be turned on. The part in the image called ‘Command Line Tools:’ was blank, so I toggled on the only option available. I tried creating a new project and it worked.