When Xcode opens the last project on launch it's listed in red with no files

377 Views Asked by At

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?

2

There are 2 best solutions below

0
On

In my case the issue was caused by a faulty location value on the FileRef element in the project.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:

<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:">
   </FileRef>
</Workspace>
0
On

I also get bothered by this problem for a long time(this comment is 2 years after your first post, for now, it's 2020-3-12).

A little different is, your project is red, mine is black but dim.

My workaround is hold alt/option and shift key, click icon of Xcode on dock, Xcode shows the welcome page, then double click the project.