无法读取Info.plist,因为它的格式不正确

时间:2018-11-09 04:05:55

标签: xcode xamarin.forms xamarin.ios info.plist

我的问题是关于打开Info.plist文件时出现此错误:

  

Info.plist格式不正确,因此无法读取

当同时从vs for mac或xcode打开时,tha plist文件可能出什么问题了?这是我的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>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
        <integer>2</integer>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>MinimumOSVersion</key>
    <string>10.3</string>
    <key>CFBundleName</key>
    <string>MovesaGarantias</string>
    <key>CFBundleDisplayName</key>
    <string>MovesaGarantias</string>
    <key>CFBundleIdentifier</key>
    <string>com.yourcompany.MovesaGarantias</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
  <key>NSLocationAlwaysUsageDescription</key>
  <string>Can we use your location at all times?</string>
  <key>NSLocationWhenInUseUsageDescription</key>
  <string>Can we use your location when your app is being used?</string>
  <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
  <string>Can we use your location at all times?</string>
  <key>NSCalendarsUsageDescription</key>
  <string>Needs Calendar Permission</string>
  <key>CFBundleIconFiles</key>
    <array>
        <string>Icon-60@2x</string>
        <string>Icon-60@3x</string>
        <string>Icon-76</string>
        <string>Icon-76@2x</string>
        <string>Default</string>
        <string>Default@2x</string>
        <string>Default-568h@2x</string>
        <string>Default-Portrait</string>
        <string>Default-Portrait@2x</string>
        <string>Icon-Small-40</string>
        <string>Icon-Small-40@2x</string>
        <string>Icon-Small-40@3x</string>
        <string>Icon-Small</string>
        <string>Icon-Small@2x</string>
        <string>Icon-Small@3x</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>   
    <key>XSLaunchImageAssets</key>
    <string>Resources/Media.xcassets/LaunchImages.launchimage</string>
</dict>
</plist>

错误还显示Xamarin与Mac不支持标签Key。

2 个答案:

答案 0 :(得分:0)

我认为问题在于您有一个值数组,但第34行上没有键:

  <key>NSCalendarsUsageDescription</key>
  <string>Needs Calendar Permission</string>
    <array>
        <string>Icon-60@2x</string>

<array>标记之前,您需要输入<key>Keyname</key>

答案 1 :(得分:0)

现在您已经更正了plist文件,它是有效的,并且可以在Xcode中正常打开:

enter image description here