xcodebuild: error: Could not resolve package dependencies: Authentication failed because no credentials were provided.
The error occurs when Swift Package Manager attempts to resolve a private repository dependency.
Private repositories always require SSH authentication so you need to make sure that Bitrise can access them with an SSH key. You can read more in our relevant guide.
In addition, an entry needs to be added to the
known_hosts file in the
.ssh directory. To do so:
- Add a Script Step to your Workflow.
- In the Script contents input, add this script:
for ip in $(dig @188.8.131.52 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts