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

拟墨画扇 提交于 2019-11-28 18:47:00

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

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:

  <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:

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

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 CFBundleShortVersionString with more than 2 decimal points will result in an archive's submission to iTunes Connect to fail now.

You now must have a CFBundleShortVersionString like 1.0, 4.5.2, etc. to successfully submit your applications. Could be a bit annoying, but I suppose it makes sense.

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

  • 3-component max for CFBundleShortVersionString (ex: 4.2.3)
  • A build number CFBundleVersion

The CFBundleShortVersionString is the version shown on the App Store. The CFBundleVersion will need to change for every build you upload.

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 CFBundleVersion value

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

# 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:

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

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.

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)

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."

Blockquote

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!