XCBUtil.PropertyListConversionError 在 Xcode

XCBUtil.PropertyListConversionError in Xcode

当我尝试 运行 我的项目时,出现此错误,指向我本地化的 .strings 文件:

read failed: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 1.)

我该怎么做才能解决这个问题?

错误指向的 .string 文件中存在格式错误。可本地化的 .strings 文件应在引号 中包含 字符串(如果它们包含一个以上的单词 and/or 特殊字符)并且在末尾包含 分号 行数,例如:

string = translation;
"another string" = "another translation";

错误请参考this solution

你应该执行

/usr/bin/plutil -lint <path to .strings file>

在终端中找到确切的问题。

就我而言,我在 info.plist 中发生了冲突,但我忘记解决了。

当您的 info.plist 文件结构错误时,这很常见。

对于 flutter 开发

变化自

<key>UISupportsDocumentBrowser</key>
<bool>true</bool>

<key>UISupportsDocumentBrowser</key>
<true/>

我遇到了错误 XCBUtil.PropertyListConversionError error 2.)。它发生在组合 INFOPLIST_OTHER_PREPROCESSOR_FLAGS = -traditionalINFOPLIST_PREFIX_HEADER 中,其中包含以 // 开头的评论。所以我通过将注释更改为旧样式来修复它:/* */