UE4 4.26 gives Xcode not installed pop up

Hello I have downloaded Unreal engine 4.26 in my M1 MBP. I was able to create a C++ project FPS template project and compile the code successfully but when I try to change the code autocomplete is not working and code highlighting also not working in Xcode correctly. So I went to project settings and switched to VS Code and restarted the Editor. Now When I select generate VSCode project It gives me this pop up

And when I try to create new C++ project it gives me C++ compiler not found install Xcode but I already have Xcode 12+ installed in my Mac as I use it for iOS development. How can I solve this problem and also fix intelligence bugs in Xcode should I need to give certain permissions?

And also I get this weird error in Xcode but the code compiles and works successfully.How can I get rid of these errors.