agvtool doesn't update extension Marketing Version

We have a bit of a complicated build process and need to build the Widget outside of our main app and repackage since we are using a cross platform framework. I tried scripting out updating my Widget's Marketing Version but agvtool won't update the MARKETING_VERSION in the project.pbxproj file. Therefore, we end up getting these emails from Apple:

ITMS-90473: CFBundleShortVersionString Mismatch - The CFBundleShortVersionString value ‘1.2.2’ of extension ‘MyiOSApp.app/PlugIns/widgetExtension.appex' does not match the CFBundleShortVersionString value ‘1.2.3' of its containing iOS application ‘MyiOSApp.app'.

I run this and it says it's updating in the Widget plist (but not the project.pbxproj) so when I build with xcode via command line it doesn't update and when we submit to the App Store we get the above message from Apple:

/usr/bin/agvtool new-marketing-version $(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ../My.Crossplatform.App/My.Crossplatform.App.iOS/Info.plist)
Setting CFBundleShortVersionString of project ios to: 
  1.2.3.

Updating CFBundleShortVersionString in Info.plist(s)...

Cannot find "ios.xcodeproj/../YES"
Updated CFBundleShortVersionString in "ios.xcodeproj/../widget/Info.plist" to 1.2.3

I've had to resort to manually updating then submitting every time. What is the correct way to update the MARKETING_VERSION in the project.pbxproj file in a CI environment using bash?

Post not yet marked as solved Up vote post of MNVerdeDev Down vote post of MNVerdeDev
4.3k views

Replies

Hi. Have you figured this ../YES thing out?

Haha... asked and then remembered --- need to set GENERATE_INFOPLIST_FILE to NO in order for this to work.

Check this thread on using build configuration files to externalise versions for easier updating by your own scripts: https://developer.apple.com/forums/thread/709065?answerId=718911022#718911022

This actually needs to be a BUG REPORT.

The agvtool tool fails when the key GENERATE_INFOPLIST_FILE is present. I assume that the agvtool tool is looking for the key INFOPLIST_FILE, but isn't coded correctly to exclude a result of INFOPLIST_FILE being prefixed with GENERATE_, so it tries to find the location of the Info.plist file using GENERATE_INFOPLIST_FILE value of YES. Which FAILS.

If a dev wants to add custom fields to Info.plist, then an Info.plist is still written to disk at the location specified by INFOPLIST_FILE.

Cheers.

Post not yet marked as solved Up vote reply of knev Down vote reply of knev

Did anyone figure out how to solve this? I am also getting this Cannot find "MyApp.xcodeproj/../YES" error from agvtool (Xcode 15):

$ xcrun agvtool next-version -all
Setting version of project MyApp to:
    3.

Also setting CFBundleVersion key (assuming it exists)

Updating CFBundleVersion in Info.plist(s)...

Cannot find "MyApp.xcodeproj/../YES"