Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

InfoPlist.strings path and SVN

Hello all,


I am facing an issue for which I can't seem to find a solution.


I am working on a project which has 2 localizations, english and french.


The default localization is english, and I added the french one afterwards.


So far so good, the InfoPlist.strings are localized and I can see the two different files for this:


InfoPlist.strings (English)

InfoPlist.strings (French)


However, I am using SVN for source control, and when I commit the project on one machine, and do an update on another, i get a build error stating that


"The file InfoPlist.strings couldn't be opened because there's no such file".


I gathered that this error is due to InfoPlist.strings (French) not being found. Indeed, this file is red in the project navigator.


When I click on the file and check its identity (in the right pane of Xcode), I can see that its path is in fact the absolute path to the file on the other machine that did the SVN commit.


The problem is that the path is uneditable. The "Location" dropdown menu is grayed out (and blocked on "Absolute"), so I have no way of changing the path to a relative path which, I believe, would solve the problem.


The only workaround is to remove the french localization and re-add it again, which, as I'm sure you'll agree, is far from ideal.


Is there any way to change the absolute path of the localized InfoPlist.strings file to a relative path ?


Thanks in advance,


Regards

Xcode-OTHER, iOS 5

Posted on Feb 20, 2012 8:30 AM

Reply
2 replies

May 10, 2012 2:38 AM in response to Mutix

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 .

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 🙂

InfoPlist.strings path and SVN

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.