How to tell Xcode where my info.plist and .pch files are
XcodeXcode Problem Overview
I renamed my project and it's files and now Xcode is still looking for the old info.plist file. Where do I set the locations of the .plist and .pch files that it needs.
In my Project Info window, under Packaging there's an item for Info.Plist file, but it was blank, and when I try different paths, nothing happens. On compile it still says it can't find the plist by the old name.
Xcode Solutions
Solution 1 - Xcode
I know this answer is answered and closed, but I'm going to add my discoveries here as it is slightly different for Xcode 4.2:
- Select your project
- In the left side of the middle pane, select your app under "Targets"
- Select the tab "Build Settings"
- Search the following keywords: "info.plist" and "pch"
- At this point it should be pretty clear which are the ones you need to modify.
- Click on "Validate Settings" and you're done.
Solution 2 - Xcode
Found it. It was in the settings for the Target.
- Choose Target in the Groups and Files pane on the left.
- Right-Click and choose Get Info
- Search for "Info.Plist" and type in the filename for the correct plist file into the property of the item named "Info.Plist File".
- Then search for "Prefix" and find the item named "Prefix Header".
- Change it's property to the name of the correct .pch file that you are using.
I think these different "Info" windows are confusing. You have to make sure the right file is selected in the Groups and Files pane before selecting "Get Info", and it's hard to tell if what you're doing is actually making changes to the Info.plist file, or where your changes are being saved.
Solution 3 - Xcode
For Xcode 10.1 when rename or move info.plist to sub folder.
- Select your project
- Choose targets
- In
General
tab underIndentity
you can specify new info.plist file
Solution 4 - Xcode
One more wrinkle to this. It still would not find the new plist file because it was in a folder inside the main project hierarchy on my disk. In this case, the name you should put in the build settings is relative to the project file, like "FolderName/Info.plist" for example.
Solution 5 - Xcode
Just close project and reopen it. Then you will see on the project target, choose plist button on the General tab See this screenshot to make sense
Solution 6 - Xcode
I know this is an old post, but I just ran into this same problem using Xcode 8.2. I had already duplicated .plist and .storyboard files in finder, but my Xcode project did not pick them up. In order to add files to your xcodeproj just right click on the project or folder in the Project Navigator and select Add Files to "Your Project Name". You should be able to select the files you need (use Cmd key to select multiple individual files).
If you created a new .plist or .storyboard file you'll need to link to your target membership. To link just click on the file in the navigator and on the right hand side in your standard editor > file inspector > target membership select the appropriate target membership.
The correct way to do this without duplicating files in finder is by selecting the file to duplicate and then going to File > Duplicate on the Xcode navigation menu.
Solution 7 - Xcode
I am working with Xcode 9.3 and "boldly" changed my app name without understanding that I was inviting trouble: I got it.
Fortunately, it is now easy to rename a project or app with reliable results if in Xcode you select the blue icon on the left/in the project navigator and then edit the "Identity and Type" "Name" field in the "File Inspector". This brings up a dialog, and clicking on "Rename" works reliably.
Solution 8 - Xcode
From XCode 11 onwards, the updated path for Info.plist has to be changed under Target -> Build Settings -> Packaging -> Info.plist File.
Please read here for further details