繁体   English   中英

xcode 验证错误:info.plist 文件缺少所需的密钥:CFBundleVersion

[英]xcode VALIDATION error: The info.plist file is missing the required key: CFBundleVersion

我尝试在摘要和 plist 文件中输入版本号,但仍然出现相同的错误。

CFBundleVersion 虽然存在于 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>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleGetInfoString</key>
    <string></string>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>Calmness_icon_ratina.png</string>
                <string>Default.png</string>
                <string>Default@2x.png</string>
                <string>Calmness_icon57.png</string>
            </array>
            <key>UIPrerenderedIcon</key>
            <true/>
        </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.jassem.calmness</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1</string>
    <key>CFBundleSignature</key>
    <string>BNDL</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSApplicationCategoryType</key>
    <string></string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
    </array>
    <key>UIPrerenderedIcon</key>
    <true/>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIStatusBarHidden</key>
    <true/>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
</dict>
</plist>

很可能是 xcode 本身的问题。 尝试清理,删除管理器中的派生数据,重新启动 Xcode。 如果这不起作用,请在项目窗格中检查,总而言之,如果版本和构建都说 1.0。

出于某种原因,Xcode 找不到提到的密钥。

  • 查看目标的构建设置,您已设置 info.plist 的路径
  • 删除您的派生文件文件夹,您可能在此处拥有该文件的旧版本
  • 如果你在 Finder 中双击他的 plist,它是否正确打开? 你可能不小心损坏了它
  • 创建一个新项目并将您的 info.plist 替换为新项目

您需要转到 info.plist,添加一个名为:“Application Category”的新键,然后选择您设计的类别。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM