Xcode 15.3 broke agvtool version management

The new version of Xcode 15.3 broke the behavior of incrementing build numbers with agvtool which I used to automate to update the build number after each build.

The observation is that after running this in my project directory:

agvtool bump

Xcode removed the section "Package Dependencies" in the project navigation pane which results in failing a subsequent build with this error message:

Missing package product 'mypackage'

To solve this I have to reset package caches under File>Packages. This will restore the Package Dependencies section in the navigation pane of Xcode. It seems to be a bug of the new Xcode version 15.3 as this was working without any issues in the previous versions.

Any idea?

Answered by rafisaar in 793999022

Looks like this issue has been resolved in Xcode 16.0 beta 2 (at least that's what I'm using now). I can run agvtool bump -all and it won't break anything and next build will run just fine.

However, I was only able to run it as a script as a build post-action. If I put it as a build pre-action or as a build phase, the build will just cancel.

This doesn't seem to be an issue with agvtool but rather the package cache. Every time I run pod install I have to refresh the cache. Sometimes when I open Xcode 15.3 it fails to load the cache. When I switch branches... it fails to load the cache.

Same thing happened here and it took me a while to figure out the cause of this issue. Very frustrating.

My current workaround is to add the command for automatically resolving the dependencies immediately after bumping the build number, as follows:

cd "${PROJECT_DIR}" && agvtool bump && xcodebuild -resolvePackageDependencies

Would love for this to be fixed soon or the letting us know the reason behind it if this is an intended behavior.

Solved issue! fix the the version of Package.resolved to 2, then you can use agvtool normally.

Steps:

  1. Resolve package dependencies manually. This will recreate Package.resolved (observe that version is 3 at the end of file)
  2. Modify changing version from 3 to 2 (save)
  3. Build or Run normally and use your scripts in Run Phase or Post-action in your scheme.

Looks like this issue has been resolved in Xcode 16.0 beta 2 (at least that's what I'm using now). I can run agvtool bump -all and it won't break anything and next build will run just fine.

However, I was only able to run it as a script as a build post-action. If I put it as a build pre-action or as a build phase, the build will just cancel.

Xcode 15.3 broke agvtool version management
 
 
Q