# Xcodebuild: Could not resolve package dependencies

**URL:** https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726
**Category:** Builds
**Created:** [July 24, 2020, 11:18am UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726 "2020-07-24T11:18:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![PabloStrydal](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@PabloStrydal](https://discuss.bitrise.io/u/PabloStrydal)
#### Post date: [July 24, 2020, 11:18am UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726/1 "2020-07-24T11:18:08Z")

</div>

## 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

- Can it be reproduced on your own Mac/PC by following our [local debug guide](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)?: No

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

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

---

<div class="post-metadata">

### Author: ![kylebrowning](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/kylebrowning/32/2589_2.png) [@kylebrowning](https://discuss.bitrise.io/u/kylebrowning)
#### Post date: [July 27, 2020, 3:47pm UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726/2 "2020-07-27T15:47:57Z")

</div>

Happening to me as well.

---

<div class="post-metadata">

### Author: ![mmcnamara\_traeger](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@mmcnamara\_traeger](https://discuss.bitrise.io/u/mmcnamara_traeger)
#### Post date: [July 30, 2020, 6:14pm UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726/3 "2020-07-30T18:14:44Z")

</div>

Same issue.

---

<div class="post-metadata">

### Author: ![PabloStrydal](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@PabloStrydal](https://discuss.bitrise.io/u/PabloStrydal)
#### Post date: [August 12, 2020, 8:50am UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726/4 "2020-08-12T08:50:30Z")

</div>

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 🙌

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)
#### Post date: [September 11, 2020, 8:50am UTC](https://discuss.bitrise.io/t/xcodebuild-could-not-resolve-package-dependencies/13726/5 "2020-09-11T08:50:34Z")

</div>

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