15

I copied a project between 2 macs. I got the error message about Info.plist not found in Xcode 4 ProcessInfoPlistFile:

could not read data from '/Users/iamme/Documents/XCode/myapp/myapp/myapp-Info.plist': The file “myapp-Info.plist” couldn’t be opened because there is no such file.

As advised in Xcode can't open Info.plist -- error says "there is no such file" I went to build settings and put the right path - which I copied and pasted from file path shown in Xcode.

Unfortunately when compiling I got exactly the same message. So where else is Info.plist path stored?

Update: I have put relative path as advised but still get the error (give full message in activity log):

Process myapp/myapp-Info.plist
ProcessInfoPlistFile /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist myapp/myapp-Info.plist
    cd /Users/username/Documents/XCode/myapp
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility myapp/myapp-Info.plist -genpkginfo /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/username/Library/Developer/Xcode/DerivedData/myapp-ancooijwpdbuzbbggnsalnhvckyr/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
Community
  • 1
  • 1
user310291
  • 36,946
  • 82
  • 271
  • 487

5 Answers5

33

Don't use an absolute path here, use a path relative to your project file.

The default layout for Xcode projects is this:

CodeName.xcodeproj
CodeName/
    CodeName-Info.plist
    CodeName-Prefix.pch

Graphically, that looks like this in Finder: Project Layout in Finder

In this case, you'd want Info.plist File to be CodeName/CodeName-Info.plist.

Here, I've selected the Xcode project, target, and used the search bar to limit the settings being shown:

Info.plist setting

Finally, check that your project is including the info.plist file from the right location.

Info.plist location

Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
  • Thanks I put relative path but still got problem please see my update. – user310291 Mar 27 '12 at 00:33
  • Oh, did you mean the same error? Well, the other thing it could be is the relative path of the Info.plist. That's in Supporting files. I'll update tne answer accordingly. – Steven Fisher Mar 27 '12 at 00:56
  • I check that too and path is correct: I can open its directory clicking on the arrow shown on the right panel. I really don't understand where he keeps memory of a path that doesn't exist. – user310291 Mar 27 '12 at 13:02
  • 1
    It might be time to use a text editor on the project files and see if there's any absolute paths inside. I would not change them there, just use it for inspection. Search for "/Users". – Steven Fisher Mar 28 '12 at 17:08
  • I tried to open it with text editor but it refuses. I achieved to open it with sublime text but it shows a tree of folders nodes and it can't search or find /Users – user310291 Mar 29 '12 at 21:29
  • Open the xcode project using **Show Package Contents** in Finder. The file that contains all the paths is `project.pbxproj`. Don't make any changes using the text editor, just look. :) – Steven Fisher Mar 30 '12 at 20:49
  • 1
    in XCode 10 I've chosen ```relative to Project``` location instead of ```relative to Group```, and the issue had gone! – joliejuly Oct 05 '18 at 17:56
  • 1
    @joliejuly Yeah, Project or Group should be fine. Project might make more sense now that Xcode tries to maintain directories. – Steven Fisher Oct 05 '18 at 20:12
10

Select your project Target go to Build Phase, then select "Copy Bundle Resources", you would see red highlighted file references just remove those references, again add all those files. Now perform clean and build.

For a safety check just verify the Info.plist file path in "Build Settings"> Packaging section.

Warning : Never add Info.plist in "Copy Bundle Resources" build phase in your iOS project.

j0k
  • 22,600
  • 28
  • 79
  • 90
Anshul Sharma
  • 166
  • 1
  • 5
2

If you change your folder name then must need to be updated on Build Settings. Under Packaging set your Info.plist File path. And make sure that the file is in your project.

enter image description here

Md Imran Choudhury
  • 9,343
  • 4
  • 62
  • 60
2

You can specify the Info.plist file in Xcode inside the project's settings, under your target in the "General" tab:

screenshot of Xcode Target Project settings

shim
  • 9,289
  • 12
  • 69
  • 108
Nebø
  • 21
  • 1
-1

Here

Choose new file from here manually, a new path will be added automatically

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129