简体   繁体   中英

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:

在此处输入图片说明

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:

在此处输入图片说明

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:

在此处输入图片说明

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM