Is there a way to stop Xcode showing historical warnings/errors

Xcode has this 'special' habit of showing old errors on builds. Sometimes from long ago.

presumably there is a cache somewhere that isn't getting invalidated.

Clearing the build folder doesn't fix this. Has anyone found a way that does?

Answered by acton-donn in 788638022

Product > Clear All Issues will remove them.

Product > Clear All Issues will remove them.

I've investigated this issue frequently since it first in Xcode appeared 5 years ago, and the only way I've found to actually fix the issue is to run this in Terminal:

rm -rf ${HOME}/Library/Developer/Xcode/DerivedData

That will permanently get rid of the phantom warnings and errors you're seeing. However, you'll have to run this again each time new warnings and errors appear.

The other downside is that after deleting the DerivedData folder, you'll have to do a full rebuild of your project, which can be time consuming.

The suggested solution, using Product > Clear All Issues, only removes the warnings and errors temporarily. They will usually return the next time you build your project.

I'd like to the known the answer to this also. I end up deleting DerivedData 5 to 10 times per day on a a large project. Often I get corrupted database error, but just rebuilding again seems to fix it.

Is there a way to stop Xcode showing historical warnings/errors
 
 
Q