4

I have a strange problem in my xcode project. When i want to import or export a localization xcode gives the following error message:

/usr/bin/xmllint exited with status 1

Some research tells me that status 1 means Unclassified but i cannot find what that means and where i should look for the answer.

I have tried to do this on 2 other macs but all show the same error. Somehow it looks like it cannot parse my project.

Can anyone point me in the right direction?

4

2 回答 2

6

为同样的问题苦苦挣扎了 2 天。最后我决定使用终端导出本地化。这是使用终端导出的代码

xcodebuild -exportLocalizations -localizationPath <dirpath> -project <projectname> [[-exportLanguage <targetlanguage>]]
  1. 转到您拥有项目的路径,在 dirpath 中再次给出项目的路径,并在projectname中给出您的项目名称,包括扩展名。请也删除 <>。将 [[-exportLanguage targetlanguage]] 替换为-exportLanguage fr,因为我想要法语,所以我使用了fr

只需按回车即可。终端也给了我同样的错误/usr/bin/xmllint exited with status 1

但与 Xcode 不同的是,终端提供了一些额外的信息。它告诉我解析问题的地方。就像在我的情况下,我将一些按钮命名为“CC”,即 CC 和三个空格。我删除了空间并再次尝试通过 XCODE 导出本地化并最终获得成功。

PS:通过终端导出本地化并不能保证 100% 成功,但至少它告诉我有问题的地方。

要了解有关本地化的移动,请 在此处输入链接描述

于 2015-05-20T07:22:59.990 回答
3

我有一个类似的问题,我设法解决了它。在我的例子中,xliff 文件确实输出了,但它在我的一个 UI 元素中的某个文本区域周围的格式不正确。这是我的出发点。

删除在那里输入的文本并重新导出后,错误代码就消失了。我的猜测是字符串中有一些不正确的字符编码导致 xmllint 抛出错误。

我意识到这是模糊的回应,但很难找到这个问题的根源。我想说的是在你的项目中寻找正在输出文本的区域,并寻找你可能在文本中复制粘贴而不是输入文本的区域。我确信还有其他方法可以引发此错误,但这是我的解决方案。我希望它有帮助:)

于 2015-03-12T01:48:27.217 回答