Xcode Cloud: How to configure Xcode for both local and remote dependencies?

The Situation

Our SwiftUI project uses three Swift packages (hosted on GitHub in private repositories):

  • a custom UIKit package
  • a custom BackendKit package
  • a custom ApplicationKit package

From the filesystem perspective it looks like this:

OurApplication/
CustomUIKitPackage/
CustomBackendKitPackage/
CustomApplicationKitPackage/

I added all three packages as local dependencies (because we need to edit them constantly) by dragging their folders into the project workspace. In the Xcode project navigator they are now under a Packages group.

I also added remote dependencies for all three packages to the Xcode project by using their git@github.com:... URL. Access to these three private repos are already granted.

The Problem

With this configuration I can work on the project and on all three packages as well. I can make changes, run tests, all the stuff - No problem.

Triggering an Xcode Cloud build it will always fail saying something weird of:

an out-of-date resolved file was detected at /Volumes/workspace/repository/MY_PROJECT.xcworkspace/xcshareddata/swiftpm/Package.resolved, which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependencies. Running resolver because the following dependencies were added: 'CustomBackendKitPackage' (git@github.com:MY_COMPANY/CustomBackendKitPackage.git)xcodebuild: error: Could not resolve package dependencies:

Removing all three local dependencies out of MY_PROJECT/Packages/*, pushing everthing to GitHub and running an Xcode Cloud build again, it works as expected. All three remote dependencies with its git@github.com:... URLs are being used correctly and the Xcode Cloud build turns green.

The Question

How do I configure Xcode correctly so that I have my local packages for development at the same time as Xcode Cloud uses the remote references?

Post not yet marked as solved Up vote post of woodbytes Down vote post of woodbytes
1.2k views

Replies

Same problem here, for me it's failing with GitHub packages (to be specific "Alamofire", "****" and "SwiftyJSON"). I got the same error message like you and I can't find a way to correct it. The package.resolved file is up to date on remote branch so I don't know how should I configure it correctly.