xcode CFBundleVersion 必须是最多三个非负整数的句点分隔列表(警告 ITMS-9000)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25418798/
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 05:25:19  来源:igfitidea点击:

CFBundleVersion must be a period separated list of at most three non-negative integers (WARNING ITMS-9000)

iosxcodebuildapp-store-connect

提问by Segev

I'm getting this warning when trying to submit my app:

尝试提交我的应用程序时收到此警告:

enter image description here

在此处输入图片说明

WARNING ITMS-9000: "This bundle is invalid. The value for key CFBundleVersion [3.3.9.2014.08.20] int the info.plist file must be a period separated list of at most threenon-negative integers."

警告 ITMS-9000:“此包无效。info.plist 文件中的关键 CFBundleVersion [3.3.9.2014.08.20] 的值必须是最多三个非负整数的句点分隔列表。”

This is the first time I'm seeing this after a lot of submissions with that versioning format.

这是我第一次看到这种版本格式的提交很多之后。

Is something changed regarding CFBundleVersion ?

CFBundleVersion 有什么变化吗?

I'm guessing the threewasn't always there? or apple just started warning us about it?

我猜这三个并不总是在那里?还是苹果刚刚开始警告我们呢?

From the Apple docs:

来自苹果文档

CFBundleVersion

CFBundleVersion (String - iOS, OS X) specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The build version number should be a string comprised of three non-negative, period-separated integers with the first integer being greater than zero. The string should only contain numeric (0-9) and period (.) characters. Leading zeros are truncated from each integer and will be ignored (that is, 1.02.3 is equivalent to 1.2.3). This key is not localizable.

CFB包版本

CFBundleVersion (String - iOS, OS X) 指定包的构建版本号,它标识包的迭代(已发布或未发布)。构建版本号应该是一个字符串,由三个非负的、以句点分隔的整数组成,第一个整数大于零。该字符串应仅包含数字 (0-9) 和句点 (.) 字符。每个整数的前导零都被截断并被忽略(即 1.02.3 等价于 1.2.3)。此键不可本地化。

Edit:

编辑:

Apparently CFBundleVersion was changed as you can see here. It's a shame that I need to search WayBackMachine for something like that while Apple's "Document Revision History" says nothing about it.

显然 CFBundleVersion 已更改,正如您在此处看到的那样。很遗憾,我需要在 WayBackMachine 中搜索类似的东西,而 Apple 的“文档修订历史”却对此一无所知。

采纳答案by Segev

Apparently CFBundleVersion was changed as you can see here. It's a shame that I need to search WayBackMachine for something like that while Apple's "Document Revision History" says nothing about it.

显然 CFBundleVersion 已更改,正如您在此处看到的那样。很遗憾,我需要在 WayBackMachine 中搜索类似的东西,而 Apple 的“文档修订历史”却对此一无所知。

回答by Esqarrouth

This happened to a framework I was using from Cocoapods, here is how I fixed it:

这发生在我从 Cocoapods 使用的框架上,这是我修复它的方法:

You need to find non-standard CFBundleShortVersionString in info.plist file. I searched through all of them and found this in one of the repos:

您需要在 info.plist 文件中找到非标准的 CFBundleShortVersionString。我搜索了所有这些并在其中一个存储库中找到了这个:

  <key>CFBundleShortVersionString</key>
  <string>HEAD based on 1.0</string>

Changed it to this:

改成这样:

  <key>CFBundleShortVersionString</key>
  <string>1.0</string>

and it worked

它起作用了

This method, created by Cocoapods developers also works:

这种由 Cocoapods 开发人员创建的方法也适用:

https://github.com/Jonge/Cocoapods-frameworks-version-number-fix

https://github.com/Jonge/Cocoapods-frameworks-version-number-fix

回答by rebello95

It looks like Apple has taken this a step further and made this an error (not sure when this happened, but I'm using Xcode 6). Attempting to submit an application with a CFBundleShortVersionStringwith more than 2 decimal points will result in an archive's submission to iTunes Connect to fail now.

看起来 Apple 更进一步,并将其设为错误(不确定何时发生,但我使用的是 Xcode 6)。尝试提交CFBundleShortVersionString具有超过 2 个小数点的应用程序将导致存档现在无法提交到 iTunes Connect。

You now musthave a CFBundleShortVersionStringlike 1.0, 4.5.2, etc. to successfully submit your applications. Could be a bit annoying, but I suppose it makes sense.

您现在必须有一个CFBundleShortVersionString1.04.5.2等才能成功提交您的申请。可能有点烦人,但我想这是有道理的。

Error

错误

回答by Erwan

The recommended best-practice is to now use separate values for CFBundleShortVersionStringand CFBundleVersion

推荐的最佳实践是现在为CFBundleShortVersionString和使用单独的值CFBundleVersion

  • 3-component max for CFBundleShortVersionString(ex: 4.2.3)
  • A build number CFBundleVersion
  • 最多 3 组分CFBundleShortVersionString(例如:4.2.3)
  • 一个版本号 CFBundleVersion

The CFBundleShortVersionStringis the version shown on the App Store. The CFBundleVersionwill need to change for every build you upload.

CFBundleShortVersionString是在App Store上显示的版本。在CFBundleVersion将需要改变你上传的每构建。

Ex: if you upload a new version (4.2.3) for review on iTunesConnect and if it gets rejected. You will need to resubmit a new build for the same version number (CFBundleShortVersionString= 4.2.3) with a different CFBundleVersionvalue

例如:如果您上传新版本 (4.2.3) 以在 iTunesConnect 上进行审核并且被拒绝。您将需要重新提交CFBundleShortVersionString具有不同CFBundleVersion值的相同版本号 ( = 4.2.3)的新版本

回答by KlimczakM

If you're using CocoaPods, add this script to Podfileto handle non-numeric bundle versions:

如果您正在使用CocoaPods,请添加此脚本Podfile以处理非数字包版本:

# fix for non numeric CocoaPods versions
# https://github.com/CocoaPods/CocoaPods/issues/4421#issuecomment-151804311
post_install do |installer|
  plist_buddy = "/usr/libexec/PlistBuddy"
  installer.pods_project.targets.each do |target|
    plist = "Pods/Target Support Files/#{target}/Info.plist"
    original_version = `#{plist_buddy} -c "Print CFBundleShortVersionString" "#{plist}"`.strip
    changed_version = original_version[/(\d+\.){1,2}(\d+)?/]
    unless original_version == changed_version
      puts "Fix version of Pod #{target}: #{original_version} => #{changed_version}"
      `#{plist_buddy} -c "Set CFBundleShortVersionString #{changed_version}" "Pods/Target Support Files/#{target}/Info.plist"`
    end
  end
end

Example output for ReactiveCocoa 4:

ReactiveCocoa 4 的示例输出:

Installing ReactiveCocoa (4.0.4-alpha-1)
(...)
Fix version of Pod ReactiveCocoa: 4.0.4-alpha-1 => 4.0.4

回答by lee

Follow the error, then search following the CFBundleVersion, in your case search: 3.3.9.2014.08.20 then change it to right version like 3.3.9 or 3.4.0,…(it must greater than the old version)

按照错误,然后按照CFBundleVersion搜索,在你的情况下搜索:3.3.9.2014.08.20然后将其更改为正确的版本,如3.3.9或3.4.0,......(它必须大于旧版本)

回答by iMinion

I was getting the Same issue as-

我遇到了与-相同的问题

Blockquote

块引用

ERROR ITMS-90058: "This bundle is invalid. The value for key CFBundleVersion [ms-08-23] in the Info.plist file must be a period-separated list of at most three non-negative integers."

错误 ITMS-90058:“此包无效。Info.plist 文件中键 CFBundleVersion [ms-08-23] 的值必须是以句点分隔的列表,最多包含三个非负整数。”

Blockquote

块引用

There after I went and searched with every Third party framework Plist and in SAP libraries I found Bundle versionas [ms-08-23]. I changed it to a format of three non-negative integer i.e3.0.0, I changed it in every Framework of SAP - IT Worked.

在我使用每个第三方框架 Plist 和 SAP 库进行搜索之后,我发现 Bundle 版本[ms-08-23]。我将其更改为三个非负整数的格式,3.0.0,我在 SAP- IT Worked 的每个框架中都将其更改。