tweaking XCode build configurations (aka Info.plist is missing)

When I start a new project in XCode, it always sort of bugs me that so many things are tossed into the main project directory. I suspect I’m not alone there. To resolve that, one of the first things that I do is start organizing stuff. Two folders immediately get created: “resources” and “src”. I throw Info.plist and the English.lproj bits into resources and main.m and the precompiled headers into src. No big deal, right? Well, sorta.

As soon as you do this the XCode project will whine a bit at you (whining in this case takes for the form of the files in the project browser getting listed in red).

Xcode complaining about missing files

This part is very easily to resolve – just click on them and choose Get Info. Once you’ve got that up, click on the “Choose…” button and you’ll get a standard file navigation window. Just click into the directory you’ve stashed the file into and select it.

Choosing a new file location with Get Info

This all worked great for me and I thought I had everything settled there until I tried to build… and damn, it didn’t work. The message I got back (after a little quick digging into the build results window) was error: The file “Info.plist” does not exist.

error: The file “Info.plist” does not exist.

Damned annoying message, because I know it exists – I just moved it.

The resolution to it really isn’t that bad, but it can be confusing. There is a build configuration “Info.plist File” that you can set. But where you really want to set it is on the target, not the project. Turns out you can set it in both places, and when I set it in just the project, it didn’t fix the problem. To resolve, find your build target and choose “Get Info” there. Click on the “build” tab and find the configuration setting (the built in search mechanism is a joy here).Setting the build configuration

You’ll see in the above example that Info.plist is sort of highlighted. Just double click on the value and change it to (in my case) resources/Info.plist and click on “OK”. If you’ve moved your precompiled headers, you’ll want to do a similar adjustment to the setting “Prefix Header”. 

Once you’ve got that completed, you’re back in action and can compile your code up without issue. And yeah, for the record – I fully expect that I’ll forget this and come looking for it again in another 9 months or something. I just hope I can find it then…

6 thoughts on “tweaking XCode build configurations (aka Info.plist is missing)

  1. I’m digging up one of your old posts – apologies. If you try to move the PCH out of the project root directory, Xcode still complains (both on Mac and iPhone builds). Any idea how to get around that one?


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s