views:

230

answers:

4

For some reason, XCode has decided to start copying a huge Prefix.pch.gch file into my application's resources folder when building. This file is not in the Copy Bundle Resources build phase, nor can I find any other project setting that should tell XCode to do this. Has anyone seen this before and know what's going on?

A: 

Are there any Copy Files phases?

Is the Prefix.pch.gch file in your project's group tree? The easiest way to check this would be to select the project object, then search for “gch” in the Detail view.

Peter Hosey
No, the Prefix.pch file is there, but not .gch file. There are two copy files phases, one that copies two frameworks (Sparkle, and another that I wrote) and another that copies the Spotlight importer for my app. The .gch file ends up in the resources directory, and when building I see in the build results where it's being copied. The build results show the bundle resources getting copied in the same order they appear in the copy bundle resources phase. The .gch file copy message appears in between two real bundle resources even though it's not in the copy bundle resources build phase.
Andrew Madsen
Andrew Madsen: If you select your target in the Targets group, does the Prefix file (either one) appear in the Detail view that way?
Peter Hosey
Hi Peter,No, the Prefix file is not in the detail view for either target in my project (the app itself and the spotlight importer). Thanks
Andrew Madsen
A: 

If you select the "Project" item of the "Project menu and then the "Detail" tab view and then select the project in the "Groups & Files" list on the left is the files listed on the right view have a checkbox? and is that checkbox checked? if so then un-check it.

geowar
Hi geowar,Thanks for the response. As I said above, the Prefix.pch.gch file does not appear in the Detail list for the project. I can't find anywhere where it shows up in the project itself.
Andrew Madsen
What about the <Prefix.pch> file? Can you send me the project file (no sources necessary)? (email: <geowar1 @ mac.com> (remove spaces))
geowar
+1  A: 

You could try doing "Show Package Contents" on your xcode project file in the finder, then opening the project.pbxproj file in a text editor (not xcode).

If you search for ".pch" and/or ".gch", you might spot something.

Sam Deane
+2  A: 

I had a problem with the same symptoms today, it turned out that it was due to one of my objective C files being included in the Copy Bundle Resources files phase of the target (either due to a drag and drop accident, or the xcodeproj file getting corrupted at some point). GCC was then helpfully including the precompiled headers for the prefix header in the target as there is a dependency from the source file.

Doing a Get Info on the source file in question didn't show all the tabs on the file info dialog, even though the file type was set to sourcecode.c.objc.

Removing the file from the project and re-adding it cured the problem.

Simon Lawrence
That was it! I had a single .m file in the Copy Bundle Resources build phase. Removing it from the project and readding it fixed the problem. Thanks!
Andrew Madsen
Right on man. Thanks so much! I think it is definitely an xcode issue, because I sure as heck didn't drag the file to copy resources!
Sam
Yeah, I certainly didn't do it on purpose. The file that was in there was a custom category on one of the builtin classes and it was something I haven't touched in a long time (this project is >4 years old at this point). Anyway, thanks again.
Andrew Madsen