The Bundle's Info.Plist Does Not Contain a Cfbundleversion Key or Its Value Is Not a String

The bundle's Info.plist does not contain a CFBundleVersion key or its value is not a string

I have the same issue with CFBuildVersion and than i found that in my project Target there is no build version inserted.

So i have just inserted build version and issue solved.
Sample Image

XCode 13 - The application's Info.plist does not contain a valid CFBundleVersion

Setting $(CURRENT_PROJECT_VERSION) as the value for CFBundleVersion is the way to solve this issue.

iOS: How to upgrade my CFBundleVersion and my CFBundleShortVersionString automatically in Xcode 11? (My old script doesn't work anymore)

Here is the complete script. I tried it with old and new projects.

 #!/bin/bash
rm -rf build

Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")

if [ "${Build}" = "" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion 1" "$INFOPLIST_FILE"
else
Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Build=$(echo "scale=0; $Build + 1" | bc)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $Build" "$INFOPLIST_FILE"
fi
if [ "${Version}" = "" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString 1.00" "$INFOPLIST_FILE"
else
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")
Version=$(echo "scale=2; $Version + 0.01" | bc)
if [ "${CONFIGURATION}" = "Release" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $Version" "$INFOPLIST_FILE"
fi
fi

EDIT:

For completing the solution, I added that keys in the plist. I changed the existing values by:

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

CFBundleVersion in the Info.plist Upload Error

There's at least 1 known bug in Apple's upload server that they've not fixed for more than 12 months. Things to beware of:

  1. Apple deletes any leading zeroes inside the version number; i.e. the "whole string" is NOT treated as a number, instead the bits between dots are treated as SEPARATE numbers. e.g. "1.02" is treated by Apple as "1.2". So, for Apple, 1.02 is GREATER THAN 1.1
  2. Apple sometimes gets "confused" and seems to compare your uploaded-app to the version of a DIFFERENT app you've previously uploaded. It's happened to a lot of people, and I've seen it myself a few times
  3. Apple is supposed to be comparing the "CFBundleVersion" (i.e. "Bundle version" not the "Bundle versions string, short"); don't get mixed up.
  4. Frequently, the only viable solution is to bump the front number (e.g. the "2" in "2.4" -- increase it to "3")
  5. The version number you upload is unrelated to the version number that appears in iTunes - you can put anything you want there, and that's what your users will see
  6. ...except, if you also report the "actual" version number inside your app, the user will see the CFBundleVersion (usually, depends how you code it), rather than the iTunes version (which - I think - cannot be accessed from inside your app)


Related Topics



Leave a reply



Submit