C++ project creation refused, UE can't find Xcode

I have been having trouble getting Xcode to be recognized on my Mac I am using

macOS Catalina 10.15.7

Xcode 12.0.1 (12A7300)

I have done all solution recommended here but still not able to get it to recognize Xcode I have brew installed but don’t think it should have any issues with Xcode or UE as it never has before. I have tried multiple version of the engine going from 17.0.2 to 26.0p1.

Is there any way to tell Unreal Engine where Xcode is installed?
or know what version of Xcode is required for the engine version I am using.
or where I can find a debug log from the engine starting. as that may give me some insight to what’s wrong.
Or is there a way to scaffold out a C++ project without Xcode on a macbook pro.

Turns out your default editor must be Xcode to scaffold a new c++ project. Where as mine was set to visual studio code as its the one I am most familiar with and use everyday at work. So if you have this issue make sure your default editor is on Xcode and you don’t have gcc or clang installed with home-brew as that can cause conflicts with the system versions which UE4 will try to use.