【问题标题】:Info.plist : the data couldn't be read because it isn't in the correct formatInfo.plist :无法读取数据,因为它的格式不正确
【发布时间】:2019-07-24 15:00:21
【问题描述】:

我试图在 iPhone 上测试我的项目(bulidbox 游戏), 导出项目,在xcode上打开,当我尝试运行时,出现如下错误:

错误:无法解析“/project/ios/BBplayer/Info.plist”的内容:无法读取数据,因为它的格式不正确。

我查看了过去的 StackOverflow 问题,发现大约 7 个帖子在相同的问题中,但仍然无法解决此问题

有什么办法可以解决这个问题吗?

xcode 10;

info.plist 文件内容作为源代码打开

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDisplayName</key>
    <string>en</string>
    <string>Ring & Wall</string>
    <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconName</key>
    <string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
    <string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

【问题讨论】:

  • 这对我有帮助。我不知道为什么它被否决了。

标签: ios xcode info.plist buildbox


【解决方案1】:

您似乎一直在尝试将 Info.plist 编辑为源代码。别。你不知道怎么做,你很可能会弄乱格式并破坏 Info.plist。

在这种情况下你有两个错误:

<key>CFBundleDisplayName</key>
<string>en</string>
<string>Ring & Wall</string>

1

&lt;key&gt; 条目后面不能有两个 &lt;string&gt; 条目。

2

您不能在 XML 中使用 & 符号。你的意思是&lt;string&gt;Ring &amp;amp; Wall&lt;/string&gt;


我再说一遍,如果您只是将手从原始 XML 上移开,让 plist 编辑器完成它的工作,这一切都不会发生。

【讨论】:

  • 说实话,我只是想在 xcode 中将游戏导出到 ipa 文件,遵循一些无法理解的步骤,我根本不想理解它,在视频中一切都是正确的,但对我来说........ 天哪
  • 但是等等,你提到的东西&是这里的错误,应该是这样的&
  • 我相信一个队友通过合并冲突/解决引起了类似的 plist 问题,这个答案有助于解决。我也有行错误,需要将&lt;true&gt; 更正为&lt;true&gt;&lt;/true&gt;。希望对其他人有所帮助。
【解决方案2】:

这一行有错误

<String>Ring & Wall</String>

删除 & 或换行 环和墙

感谢@matt

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-15
    • 1970-01-01
    • 2019-07-28
    • 2018-04-06
    • 2020-07-26
    • 2021-10-05
    • 2021-11-11
    相关资源
    最近更新 更多