I’ve had this issue for a while, and finally found what appears to be a root cause.
If you have the copyright symbol © in the Copyright Notice in Project Settings, this causes generated code files (.h, .cpp, & .cs files) to be encoded in UTF-16 (LE). Xcode cannot compile UTF-16 (LE) files on macOS.
You can fix the problem by opening the generated files in a text editor (such as TextWrangler) and resaving them as UTF-8 encoded files.
Related AnswerHub: Why are new classes encoded in UTF-16 (LE)? - C++ - Epic Developer Community Forums