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.
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:
- 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
- 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
- Apple is supposed to be comparing the "CFBundleVersion" (i.e. "Bundle version" not the "Bundle versions string, short"); don't get mixed up.
- Frequently, the only viable solution is to bump the front number (e.g. the "2" in "2.4" -- increase it to "3")
- 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
- ...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
How to Permanently Allow Usage of Camera on Trusted Websites with iOS - Safari
How to Use Kvo for Userdefaults in Swift
Running Nsurlsession Completion Handler on Main Thread
How to Get the Modulus or Exponent from a Seckeyref Object in Swift
Xcode No Valid Compiled Storyboard at Path
Hiding Cancel Button on Search Bar in Uisearchcontroller
Nsdateformatter Returns Nil in Swift and iOS Sdk 8.0
Access Iphone's Built-In Ringtones
How to Find Serial Number, Imei Number Using iOS Sdk
Uisearchbar's Cancel and Clear Buttons Not Working in iOS 7
Are Extensions Bad for Performance in Swift
How to Add Text, Shape and Signature in Photo Markup with Pencil Kit
Nsstrikethroughstyleattributename , How to Strike Out the String in iOS 10.3
How to Use Mkpolylineview in Swift
How to Expose Existing Property on Obj-C Class Using an Extension Protocol in Swift