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
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 :)
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With