5

I just saw a weird error on one of my iOS projects. I'm using Xcode 8 (last release). I have some classes that I share along with other projects. This files are added to the project by reference, in case I need to edit them, I do it just once. Everything works fine. But I saw that many of this files are on red in one of my projects. The weird thing is that everything works well. All libraries are included, everything runs perfectly. Like I said, the files are marked as red and I can not edit them directly from that project but they are not missing (paths are OK), I cannot go directly to the folder using "show on finder" option.

I tried replacing the folders. Also tried to added and copy them to the project folder. But nothing seems to be working. I know, there are many threads about this issue but none of them worked for me because my files are not missing.

Did someone see this issue?

PS. I'm using git.

4 Answers 4

13

Select the file in the Project navigator on the left, then open the right side Utilities view and select the File inspector. Then click on the little folder icon and make sure that points to the right path.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

This did help A LOT! Xcode was messing when creating new groups. After creating one, it would say "New group is a name that's already taken bla bla" (I obviously did not name it new group) and I eventually noticed that it actually did create empty groups named "New Group X" each time I created one. It did also create the rightfully named groups. But for one of them, Xcode pointed to a random "New Group X" folder I deleted, causing the problem. Thanks!
7

I have the same problem - definitely not missing files. This is too late for OP but for anyone finding this ... it might help to change the file 'Location' setting from "Relative to Group" to Relative to Project" and then clicking on the folder to reselect the file. It worked for me. I think the path of the group can get messed up.

Comments

1

I would suspect that the files are missing, but Xcode is able to still compile because it's picking up older version from the derived data directories.

I would suggest clearing your derived data to be sure.

Comments

0

the files are marked as red and I can not edit them directly from that project but they are not missing (paths are OK), I cannot go directly to the folder using "show on finder" option

Then the paths are not OK. You need to find these files and add them to the project again. Then delete the red file references.

1 Comment

I did this many many times. Always on red. But like I said I don't get any missing file errors. Everything works well.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.