简体   繁体   English

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

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

I have tried typing the version number in the summary and in the plist file, but I still have the same error.我尝试在摘要和 plist 文件中输入版本号,但仍然出现相同的错误。

The CFBundleVersion exists though in the plist file: 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>

most likely a problem with xcode itself.很可能是 xcode 本身的问题。 try cleaning, deleting derived data in organizer, restarting Xcode.尝试清理,删除管理器中的派生数据,重新启动 Xcode。 if that doesnt work check in the project pane, in summary, if the version and build both say 1.0.如果这不起作用,请在项目窗格中检查,总而言之,如果版本和构建都说 1.0。

For some reason Xcode does not find the mentioned key.出于某种原因,Xcode 找不到提到的密钥。

  • look in your target's build setting which path for info.plist you have set查看目标的构建设置,您已设置 info.plist 的路径
  • remove your derived files folder, you might have an old version of the file in here删除您的派生文件文件夹,您可能在此处拥有该文件的旧版本
  • if you double-click on he plist in Finder, does it properly open?如果你在 Finder 中双击他的 plist,它是否正确打开? You might have accidentially corrupted it你可能不小心损坏了它
  • make a new project and replace your info.plist with the new one创建一个新项目并将您的 info.plist 替换为新项目

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

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

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