I also faced this issue on a M1 Mac. It turns out that running Xcode with Rosetta fixed the issue.
To open Xcode with Rosetta, quit Xcode then go to Applications folder > right-click on Xcode > Get Info > Check Open with Rosetta. Relaunch Xcode.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: