Phonegap - 包中的 Info.plist 必须包含 CFBundleVersion 键

Posted

技术标签:

【中文标题】Phonegap - 包中的 Info.plist 必须包含 CFBundleVersion 键【英文标题】:Phonegap - The Info.plist in the package must contain the CFBundleVersion key 【发布时间】:2015-08-16 18:38:58 【问题描述】:

我已按照所有步骤生成.ipa file 并使用应用程序加载器上传它,但一直收到以下错误:

The Info.plist in the package must contain the CFBundleVersion key.
 The Info.plist in the package must contain the CFBundleShortVersionString key.

这是包含所有信息的 Hello World-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>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>$PRODUCT_NAME</string>
    <key>CFBundleExecutable</key>
    <string>$EXECUTABLE_NAME</string>
    <key>CFBundleIconFile</key>
    <string>icon.png</string>
    <key>CFBundleIcons</key>
    <dict>
      <key>CFBundlePrimaryIcon</key>
      <dict>
        <key>CFBundleIconFiles</key>
        <array>
          <string>icon-40</string>
          <string>icon-small</string>
          <string>icon-60</string>
          <string>icon.png</string>
          <string>icon@2x</string>
          <string>icon-72</string>
          <string>icon-72@2x</string>
        </array>
        <key>UIPrerenderedIcon</key>
        <false/>
      </dict>
    </dict>
    <key>CFBundleIcons~ipad</key>
    <dict>
      <key>CFBundlePrimaryIcon</key>
      <dict>
        <key>CFBundleIconFiles</key>
        <array>
          <string>icon-small</string>
          <string>icon-40</string>
          <string>icon-50</string>
          <string>icon-76</string>
          <string>icon-60</string>
          <string>icon</string>
          <string>icon@2x</string>
          <string>icon-72</string>
          <string>icon-72@2x</string>
        </array>
        <key>UIPrerenderedIcon</key>
        <false/>
      </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.phonegap.helloworld</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$PRODUCT_NAME</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>11</string>
    <key>CFBundleShortVersionString</key>
    <string>11</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string></string>
    <key>NSMainNibFile~ipad</key>
    <string></string>
    <key>UILaunchImages</key>
    <array>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>320, 480</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>320, 480</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>320, 568</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>320, 568</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>375, 667</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>375, 667</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>414, 736</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>414, 736</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Portrait</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>768, 1024</string>
      </dict>
      <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-Landscape</string>
        <key>UILaunchImageOrientation</key>
        <string>Landscape</string>
        <key>UILaunchImageSize</key>
        <string>768, 1024</string>
      </dict>
    </array>
  </dict>
</plist>

需要修复/添加什么以便我可以上传我的应用程序?!

【问题讨论】:

你在 TargetName -> General -> Identity 下有什么? @sloik 在哪里可以找到?! 【参考方案1】:

第一次打开后添加

<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>

将 1.0 替换为您想要的应用程序版本。有趣的是,每当您更改 TargetName -> General -> Identity 中的任何内容时,都应该为您生成这些版本:)

编辑:添加了显示这些设置的图像

【讨论】:

那是一个 phonegap 应用程序,所以我只在构建后获取 .ipa 文件。知道我该怎么做吗?!我添加了上述内容,但仍然没有任何效果。 你没有提到这是一个 phonegap 应用程序 :) 不能帮你解决这个问题 :)【参考方案2】:

原来www/ 目录中需要有一个config.xml,而从一开始就默认不存在。

在小部件标签中,应指定以下内容:

version="1.0.6" ios-CFBundleVersion="201406097"

每次您希望在应用商店部署新更新时都应更改版本号。我读到您可以编写一个处理版本的脚本,这样您就不必每次都手动更改它,但没有尝试过。

对于CFBundleVersion,您可以查看下面的answer 来解释它。但部署时无需更改。

【讨论】:

【参考方案3】:

只需检查它们在版本和内部版本号中或末尾不应包含空格

【讨论】:

以上是关于Phonegap - 包中的 Info.plist 必须包含 CFBundleVersion 键的主要内容,如果未能解决你的问题,请参考以下文章

如何使iOS中的PhoneGap状态栏半透明?

从 Xcode 7 和 Application Loader 上传到 iTunes Connect 失败

UIUserInterfaceStyle 键在 Xcode 12 的 Info.plist 中不可用,如何从 Info.plist 禁用 Xcode 12 中的暗模式?

我应该如何使用帮助:Snow Leopard .help 包中的 URL?

在运行时使用 Phonegap 和 Javascript 读取应用程序包中的文件

iPhone Phonegap 方向问题