无法打开文件InfoPlist.strings [英] The file InfoPlist.strings couldn't be opened

查看:366
本文介绍了无法打开文件InfoPlist.strings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我吗?我该怎么做才能修复错误文件InfoPlist.strings因为没有这样的文件而无法打开?它是在我从SVN更新我的项目后出现的。实际上我的项目中有InfoPlist.strings,我不知道为什么Xcode没有看到它。

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.

也许以下信息可以帮助您了解发生了什么:当我通过单击它旁边的三角形展开InfoPlist.strings时,它会显示:InfoPlist.strings(英文),InfoPlist.strings(德语),InfoPlist.strings(法语)。英语是黑色的,但是法语和德语是红色的,所以我认为它们可能有问题,这可能是错误的原因。此外,我有Localizable.strings,其行为方式类似。它有(当扩展时)Localizable.strings(英文),Localizable.strings(德语),Localizable.strings(法语)和InfoPlist.strings中的英语是黑色而法语和德语是红色的。

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.

当我查看项目文件夹时 - 其中有以下内容:名为en.lproj的文件夹包含Localizable.strings和InfoPlist.strings。名为fr.lproj和de.lproj的文件夹包含相同的文件 - Localizable.strings和InfoPlist.strings。好像我已经描述了一切。请解释我该怎么做。我使用Xcode 4.2

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 !

我的第二个Strings.plist文件(FR)有一个绝对路径。路径类型(绝对,相对)的下拉菜单在xcode的信息窗格中显示为灰色,因此我无法将其更改为相对路径。

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.

解决方案是在 project.pbxproj 文件中手动更改它:

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

如果打开文件查看源文件,搜索plist,找到以下行:

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>"; };

请注意路径属性是完整的该文件的路径, sourceTree 属性设置为< absolute>

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

现在更改路径,使其相对:

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

应该成为

fr.lproj/InfoPlist.strings

还要从< absolute> sourceTree 值c>到< group>

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

该行现在应如下所示:

/* 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.

保存文件,提交更改,voilà!不再没有此类文件问题:)

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

这篇关于无法打开文件InfoPlist.strings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆