xcode 无法读取数据,因为它的格式不正确。错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42469366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:48:44  来源:igfitidea点击:

The data couldn’t be read because it isn’t in the correct format. error

iosxcodeinfo-plist

提问by user7523656

I got an error, The data couldn't be read because it isn't in the correct format. Now I am making iPhone app by swift. I added several codes to Info.plist of my app, I deleted these codes. But when I wanna open Info.plist of my app, this error happen.I do not know why because I deleted all codes which I added.And I think format is really fixed. My Info.plist is like

我收到一个错误,无法读取数据,因为它的格式不正确。现在我正在快速制作 iPhone 应用程序。我在我的应用程序的 Info.plist 中添加了几个代码,我删除了这些代码。但是当我想打开我的应用程序的 Info.plist 时,发生了这个错误。我不知道为什么,因为我删除了我添加的所有代码。而且我认为格式确实是固定的。我的 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>UILaunchStoryboardName</key>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</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.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

How can I fix this?

我怎样才能解决这个问题?

采纳答案by ldindu

You've duplicated key in the info.plist file, remove the following key in the beginning

您在 info.plist 文件中复制了密钥,请在开头删除以下密钥

<key>UILaunchStoryboardName</key>

and it will resolve the issue.

它将解决问题。

回答by Mohamed Nor

I was Building flutter project , and the problem was missing <string>for key io.flutter.embedded_views_previewadding <string></string>fixed my issue , i didn't update the info.plist though it was as created by flutter , hope this will help someone using flutter

我正在构建颤振项目,<string>关键 io.flutter.embedded_views_preview添加 <string></string>修复了我的问题,但我没有更新 info.plist,尽管它是由颤振创建的,希望这对使用颤振的人有所帮助