UE4 insists XCode is not installed

I had the same issue with a project i was porting from Windows to OSX. Reinstalling XCode or Unreal did not work, and a newly created template project would work fine. My solution ended up editing the .uproject text file and removing everything except the main fields at the top and the “Modules” section. Specifically i removed the plugins section and the one that was listing the target platforms, even if it included MacNoEditor. Everything went smooth after that.