Xcode builds fail with spurious errors; whole tool is now unusable

I have a project that has been building fine up until recently, when I started seeing spurious errors flagged in the editor on lines that were correct... and when the build was reported as successful and the app ran. The lines were often flagged twice for the same "error," and selecting the suggested "fix" produced syntactically incorrect lines because Xcode replaced the wrong characters.

Now the builds are actually failing, on correct lines and preprocessing failures (allegedly missing header files that have never been missing before, with no project changes).

Also there's a lot of

Could not read serialized diagnostics file: error("Invalid diagnostics signature")

reported in the build output, although that's categorized as a warning.

Cleaning and deleting DerivedData has no effect. I'm not using CocoaPods or Swift packages, which you see cited in a lot of reports about this.

Has anyone found a workaround?

I have a similar problem starting 6/18/2023. Expected identifier or '(' in a perfectly valid .h file also the analyzer thinks the header is not in the project's scheme. Did you ever fix this?

Xcode builds fail with spurious errors; whole tool is now unusable
 
 
Q