Xcode Cloud error: Swift Package dependency for app extension

Overview

  • I have a swift package that I have added to the app target.
  • On the app extension (widget) target I have added the same package under Frameworks and Libraries.
  • I am able to archive successfully when I do it manually
  • When I start a build using Xcode Cloud I get the following errors:

Error:

An internal error was detected which caused this stage to error. The error has been logged, and you can re-run this build again.

Resolve package dependencies
Command exited with non-zero exit-code: 74

    fatal: could not read Username for 'http://github.com': terminal prompts disabledan out-of-date resolved file was detected at /Volumes/workspace/repository/<app name>.xcodeproj/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: '<package name>' (https://github.com/<user name>/<package name>.git)2022-11-11 01:21:37.643 xcodebuild[2273:9107] Writing error result bundle to /var/folders/hf/lmqg8qtx531_sq5gwgt5s3ch0000gn/T/ResultBundle_2022-11-11_01-21-0037.xcresult

Make sure that Package.resolved is up to date on the '<branch name>' branch, and that this branch has been pushed to your remote repository.

Save artifacts
Upload <app name> Build 16 Logs for <app name> archive
An internal error occurred while this artifact was being saved.

Questions:

  1. Am I missing something?
  2. How do I resolve this issue?
  3. Is it because of a server issue?
Answered by newwbee in 736109022

Approch

  1. Check if Package.resolved is checked into the repository and is pushed to remote
  2. Check if Xcode Cloud has access to your swift packages used in your project

Package.resolved

  1. Check if <appname>.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is checked into the repository and is pushed to remote

Xcode Cloud

  1. Go to AppstoreConnect > choose App name > Xcode Cloud > Select failed build number
  2. See the yellow banner with the following message
Repository Issue
-----------------                                                                                                                                       
Xcode Cloud is unable to connect to the repository “https://github.com/<github username>/<package name>.git”. Reconnect the repository to resume builds.
  1. Click Manage Repositories
  2. See the following yellow banner with the message:
Grant access to the following repositories to allow them to be used for this product.
  1. Click Grant button
  2. Start build and it should fix the issue
Accepted Answer

Approch

  1. Check if Package.resolved is checked into the repository and is pushed to remote
  2. Check if Xcode Cloud has access to your swift packages used in your project

Package.resolved

  1. Check if <appname>.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is checked into the repository and is pushed to remote

Xcode Cloud

  1. Go to AppstoreConnect > choose App name > Xcode Cloud > Select failed build number
  2. See the yellow banner with the following message
Repository Issue
-----------------                                                                                                                                       
Xcode Cloud is unable to connect to the repository “https://github.com/<github username>/<package name>.git”. Reconnect the repository to resume builds.
  1. Click Manage Repositories
  2. See the following yellow banner with the message:
Grant access to the following repositories to allow them to be used for this product.
  1. Click Grant button
  2. Start build and it should fix the issue
Xcode Cloud error: Swift Package dependency for app extension
 
 
Q