Problems with creating a C++ Project in UE 5 on a MacBook Air M1

Hello everyone,
I tried Unreal Engine 5 on a MacBook Air M1, but when I created a new project I got this error message:

The project could not be compiled. Would you like to open it in Xcode?

ERROR: Unable to find a valid SDK for Mac. Found Version: 13.2. Must be between 11.0.0 and 12.9.9
         If your Studio has it set up, you can run this command to find the SDK to install:
           RunUAT Turnkey -command=InstallSdk -platform=Mac -BestAvailable
Creating makefile for MyProjectEditor (no existing makefile)
ERROR: Platform Mac is not a valid platform to build. Check that the SDK is installed properly.

I have installed Xcode, but when I clicked “Open Xcode” nothing was done.
Please tell me what to do, so that it works!
Thank you already!

You Sir - you need to use at max XCode version 12.5.1 … this is because of the clang version XCode includes and uses … Check your clang version with the following command in macOS terminal:

dave@sib % clang --version

The output will be something like this:

Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/

This command outputs the version of clang your XCode installation includes and uses for compilations. The latest XCode version - you’re probably using - is too new … Downgrade to or parallel install another / older XCode version and switch to this version with xcode-select command in the terminal …

It’s a bit misleading but “valid SDK for Mac” correlates directly with the clang version your macOS system uses … I was struggling with this problem too for some time :wink:

Best wishes DaVe