Skip to main content
All CollectionsKnowledge BaseiOS
Xcode Archive error: "Authentication failed because no credentials were provided"
Xcode Archive error: "Authentication failed because no credentials were provided"
Updated over a week ago

Issue:

The Xcode Archive & Export for iOS Step fails with the following error:

xcodebuild: error: Could not resolve package dependencies: Authentication failed because no credentials were provided.

Possible solutions:

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:

  1. Add a Script Step to your Workflow.

  2. In the Script contents input, add this script:

    for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts

Additional information:

Did this answer your question?