Search code examples
iosxcodeversionarchive

XCode fails to validate due to invalid version in info plist


This is driving me crazy. I have finished a new version of an app that is on the app store. The current version that is for sale is 1.68. I want my new version to be 1.8. I have the new version in all the right places in my app (I've checked this dozens of times). But after I create an archive, it fails to validate because the version in my info.plist CFBundleShortVersionString [1.8] is not higher than the previously approved version [1.68]. I wasn't a Math Major, so correct me if I'm wrong, but I'm pretty sure that 1.8 is in fact larger than 1.68. I have created a record on iTunes Connect for the new 1.8 Version, it's sitting there waiting for me to upload the app. I've tried lots of other version and build number combinations and ironically, if I set it to 1.69, it validates just fine. I've also tried cleaning, deleting derived data, completely restarting everything, etc. This is NOT the first time I've updated this app. I've never had any trouble making a new version before. Any ideas?

enter image description here


Solution

  • Check the documentation on CFBundleShortVersionString:

    The release version number is a string composed of three period-separated integers. The first integer represents major revision to the app, such as a revision that implements new features or major changes. The second integer denotes a revision that implements less prominent features. The third integer represents a maintenance release revision.

    To determine which version is higher, each of those integer slots is now compared with it's counterpart. In your case the first integers are equal ('1' and '1'), and for your second integer '68' is recognized (correctly) as being bigger than '8'.

    Since Apple ignores leading zeroes, I think the closest you could get while keeping that "1.8" feeling would be going all the way to "1.80".