Xcodebuild: Could not resolve package dependencies

Description of the issue

Cannot build any iOS project which contains a SPM Package added to a Framework instead of main app Target.
It only happens running on Bitrise. Locally it builds and it also succeeds using Bitrise CLI.

error:
xcodebuild: error: Could not resolve package dependencies:
An unknown error occurred

Environment:

Where did the issue happen?

  • Xcode 11.6 on macOS 10.15.3 Catalina

Which build Step causes the issue and which version of the step?

  • It won’t pass any steps that include xcodebuild -resolvePackageDependencies
    eg: ios-auto-provisioning@1.5, xcode-test@2.4.6

Reproducibility

  • Does a “Rebuild” help?: No.
  • Does a rebuild without caches help?: No.
  • Does the issue happen sporadically, or every time?: Every time.
  • Does upgrading the build Step to the latest version help?: No.
  • When did the issue start?: After I’ve added a SPM Package to a Framework instead of the main App Target.

Local reproduction

It can’t be reproduced locally. It works well. I’ve tried:

  • Testing with a full clean git clone: running xcodebuild -resolvePackageDependencies. It succeeded.
  • Test with the Bitrise CLI: It succeeded.

Local reproduction: Linux / Android (docker based) stack builds

Build log

Happening to me as well.

Same issue.

As noted by @Robert.Bitrise, the issue was being caused by using SSH instead of HTTPS in some of the Swift Package Manager dependencies.

To fix the issue, you will need to set those dependencies to use HTTPS instead in SPM.

Note: In my case, the dependencies that used SSH had been added from inside Xcode.

Thanks again to @Robert.Bitrise for the insight :raised_hands:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.