9
votes

Can anyone please help me? What should i do to fix the error "The file InfoPlist.strings couldn't be opened because there's no such file"? It's appeared after i've updated my project from SVN. Actually THERE IS InfoPlist.strings in my project, i have no idea why Xcode doesn't see it.

Maybe the following information will help you to understand what's going on: when i expand InfoPlist.strings by clicking on the triangle next to it, then it shows: InfoPlist.strings (English), InfoPlist.strings(German), InfoPlist.strings(French). The English is black, but French and German are red, so i suppose it is probable something wrong with them and it might be the cause of the error. Also, i've got Localizable.strings, which behaves in similar way. It has (when expanded) Localizable.strings (English), Localizable.strings(German), Localizable.strings(French) and just as in InfoPlist.strings English is black whereas French and German are red.

When i look inside my project's folder - there is the following there: a folder named en.lproj contains Localizable.strings and InfoPlist.strings. Folders named fr.lproj and de.lproj contains the same - Localizable.strings and InfoPlist.strings. Seems like i've described everything. Please explain me what to do. I work with Xcode 4.2

8
did you try to delete the file and make svn update ? - Malek_Jundi
do you mean deleting files InfoPlist and Localizable? Not reference but deleting them from the disk? If yes then i tried - Andrey Chernukha
have you found a solution to this ? I'm having the same problem after adding a localization and updating from SVN - Mutix
I've just noticed in my project that in the InfoPlist.strings bundle, the default file InfoPlist.strings (English) has a relative path, whereas the one I added, InfoPlist.strings (french) has an absolute path which is grayed out and cannot be changed. The absolute path is the path from the other computer where the project was commited, which is why it's causing the problem on this computer here. Anyone know why it's grayed out ? - Mutix
Mutix - i found solution. what i did is i removed reference for InfoPlist.strings and Localizable.strings and then i added these files to the project again and it started working - Andrey Chernukha

8 Answers

10
votes

I have just managed to fix this problem !

My second Strings.plist file (FR) had an absolute path. The drop down menu for path type (absolute, relative) was greyed out in the info pane of xcode so I could not change it to a relative path.

The solution is to change it manually in the project.pbxproj file:

If you open the file to view the source, and search for "plist", find the following line:

/* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = /Users/[YOUR-USER]/[PATH_TO_PROJECT]/fr.lproj/InfoPlist.strings; sourceTree = "<absolute>"; };

Notice that the path attribute is the full path to the file, and that the sourceTree attribute is set to <absolute>.

Now change the path so that it's relative:

/Users/[YOUR-USER]/[PATH_TO_PROJECT]/fr.lproj/InfoPlist.strings

should become

fr.lproj/InfoPlist.strings

Also change the sourceTree value from <absolute> to <group>

The line should now look like this:

/* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };

Repeat these steps for all your localizations that are stuck with absolute paths.

Save the file, commit the changes, and voilà! no more no such file problem :)

3
votes

info.plist source code: like: .... {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; ....

check "path" is a absolute path?

1
votes

Had the same problem, easy fix for me: select the plist file in xcode and make sure its "Target Membership" is ON (for the build you are doing).

0
votes

The path to your Info.plist file is defined in the build settings for the target. Look and see what it's set to. If the project has come from a different machine, it might be an absolute path, but it really should be a path relative to the project root, like Sources/Info.plist.

0
votes

Best information is right here. Sorry to be so cheesy as to put a link to this - but they edited it in September - and now it makes sense...

http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html

0
votes

I just recreated the files (with empty content) it asked for in the paths it asked for them, since I am new to XCode and it didn't seem to affect my current project I decided that was a acceptable solution/shortcut to proceed.

0
votes

The solution for this particular instance of the error was “Info.plist couldn't be opened because there is no such file” was that I had deleted all of the files in the "Project Tests" folder, but was still had "Project Tests" listed under my targets. After deleting the "tests" target, the project built successfully.

0
votes

I got this error when i pulled my cohort's changes to my local so that i can review and test them. I checked all settings suggested in this thread but they all looked correct-ish. My fix was just to blow away the branch, reset to master and pull the updates to a clean branch. The ol' reboot everything technique.