Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Submodule Files showing red in XCode when moving to different Mac

Here are the details of my problem:

I have a directory structure that looks like:

enter image description here

where ios-src is all my project and source files and ios-libs is where all my git submodules live.

When I clone the project to a different machine, all the files in the ios-libs directory show up as red (or missing) in XCode (v4.3.2), however the files are present on disk.

If I delete the files from XCode and re-add them, it DOES NOT fix the problem, they are still red and the project doesn't compile.

The directories are all marked as Relative to Group.

If I choose the file in the inspector I get this:

enter image description here

Which reveals the wrong relative path. If I choose the browse button (to the right of the path) and correct it I get the correct relative path:

enter image description here

That fixes it until I go to back to the original (my home) machine. Also, if I move the ios-lib directory to be under ios-src it fixes the problem, but that is a workaround and I want to know the solution.

It seems that I have something setup wrong on my home computer as it only seems to happen when I create projects there. If I create the project on any one of my other computers, the projects work on everyone one of my machines including my home one. They are all running Lion and the same XCode version.

Any ideas on what I can do to resolve this problem is greatly appreciated. I have spent a good amount of time trying to figure it out to no avail.

like image 915
Joseph DeCarlo Avatar asked May 18 '12 15:05

Joseph DeCarlo


1 Answers

Change the Relative to Group to Relative to Project.

Groups aren't necessarily physical directories. They are simply a collection of references to files in your project.

like image 112
Simon Germain Avatar answered Sep 22 '22 16:09

Simon Germain