I had a file which I deleted and replaced with another file, somewhere else, of the same name.
Despite cleaning, and trying this multiple times, I keep getting this
In case everything fails (i.e. first try bames53 suggestion)
Ok, this might be dangerous so make a copy of your whole project first:
project.pbxproj in a text editor of your choice, but not Xcode640450991409CF5C00B3B580. Search for this and delete any line you find.Add file… dialog of Xcode. It is still in the folder of your project — if you added it successfully in the first place — you just got rid of all project references.And remember: make a copy of your whole project first — for every try. or copying the project.pbxproj might be enough.