When I open Xcode it automatically opens the last projects that were open when it quit.
I have one .xcodeproj
that gets displayed in red in the Project navigator and there are no files visible for the project. I am not able to compile the project.
Closing the window without quitting Xcode and re-opening it solves the issue and the project appears fine and I am able to compile.
I've scanned through the project.pbxproj
file and nothing jumps out at me as an issue and it's quite strange when it works after re-opening the project.
I should also note that this happens on any machine that I clone the repo to.
Has anyone seen this before and somehow solved it?
In my case the issue was caused by a faulty
location
value on theFileRef
element in theproject.xcodeproj/project.xcworkspace/contents.xcworkspacedata
file.Clear the value that your file contains and simply enter
self:
. For reference, here's how it looks in a project newly created with Xcode 12.5: