Watch app version issue in Xcode Cloud

I've been building our app to make a release in App Store with Xcode Cloud

Currently the builds are failing with the following error:

The value of CFBundleShortVersionString in your WatchKit app's Info.plist (3.9.0) does not match the value in your companion app's Info.plist (4.7.0). These values are required to match.

This is strange, as in our ci_pre_xcodebuild script we have an invocation of the code

echo "Version: ${versionNumber}"

echo "Setting version string in plists"

echo "iOS Version:"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/MainApp/Resources/Plists/Info.plist
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/MainApp/Resources/Plists/Info.plist

echo "Watch Version:"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/WatchApp/Info.plist
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/WatchApp/Info.plist

echo "Watch Extension Version:"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/WatchAppExtension/Resources/Info.plist
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString $versionNumber" $CI_WORKSPACE/WatchAppExtension/Resources/Info.plist

On which the command executes correctly and shows the right output.

Then I don't understand what's going on.

This workflow was working a couple weeks ago and we haven't done a change to it since then.

Any ideas of what could it be?

Accepted Reply

At the end I managed to solve this issue.

I wrote a blog post about it in https://tech.sats.com/ios/2023/10/15/setting-ios-app-version-with-git-tags-in-xcode-cloud.html

Replies

I was able to build.

First, I manually set the version in the project to 4.7.0 for both Apple Watch, Extension and Main app. I got some errors after that, but they seem "random errors" on the builds.

Then I noticed our workflow was using "the latest Xcode" which meant Xcode 13.3 Beta 1. Instead I set it to Xcode 12.2.1 I got some random errors after.

I tried the build hours later and finally it worked.

Since I did more than one approach trying to fix this at a time, I cannot tell what "fix" my issue.

I will report later when I make a new build and if I get more info

At the end I managed to solve this issue.

I wrote a blog post about it in https://tech.sats.com/ios/2023/10/15/setting-ios-app-version-with-git-tags-in-xcode-cloud.html