Xcode 13 strange behaviour about CFBundleVersion after uploading to appstoreconnect

Hi,

today I've seen this strange behaviour when uploading apps to appstoreconnect, the builds show as follows:

They passed from "2.1.194" to "3".

These are the values of Info.plist in xcarchive (so after archive building) of the latest build

<key>CFBundleShortVersionString</key>
<string>2.1</string>
<key>CFBundleVersion</key>
<string>2.1.195</string>

The previous builds "2.1.193" and "2.1.194" were built on Xcode 12.5 and they display the correct CFBundleVersion. The build "3" is the latest build on Xcode 13 with the above settings.

I've read on Xcode 13 Release Notes (59826409) that

... the distribution assistant in Xcode detects whether your app has a valid build number (CFBundleVersion). If your app has an invalid number (like one that was used previously, or precedes your current build number), the distribution assistant provides an option to automatically increment it to a valid number.

What's the problem with this CFBundleVersion?

Thank you in advance.

Answered by Scott J in 692104022

After seeing various reports of this behavior, it appears the new upload-time validation logic considers only the first number in a dotted version string (truncating the rest), so in this case it treats both your existing 2.1.194 and new 2.1.195 as equivalent to simply 2, which it increments to produce 3.

You can prevent this by un-checking the automatic build number option when uploading. But going forward it’s probably easiest to just switch to an integer build number rather than using a dotted format that has a redundant app version on the front. (Especially since you are now stuck incrementing from 3 for your current version.) You can reset the build number to 1 if you want for each new app version.

Accepted Answer

After seeing various reports of this behavior, it appears the new upload-time validation logic considers only the first number in a dotted version string (truncating the rest), so in this case it treats both your existing 2.1.194 and new 2.1.195 as equivalent to simply 2, which it increments to produce 3.

You can prevent this by un-checking the automatic build number option when uploading. But going forward it’s probably easiest to just switch to an integer build number rather than using a dotted format that has a redundant app version on the front. (Especially since you are now stuck incrementing from 3 for your current version.) You can reset the build number to 1 if you want for each new app version.

Thank you Scott, this sounds reasoning...

But I can't see the option

automatic build number 

when uploading.

Anyway, at this point I think someone should update the documentation about CFBundleVersion, right?

It’s the new 3rd checkbox in the options page when uploading or validating an archive. See this thread for earlier discussion of the issue and a link to a screenshot. Also the WWDC video linked from that thread is worth watching.

Xcode 13 strange behaviour about CFBundleVersion after uploading to appstoreconnect
 
 
Q