简体   繁体   中英

How to solve Unexpected HTTP status code: 404(-1)

Although I set up my xcode swift file to create a repository when I click SourceControl -> Make a Working Copy I receive the error window "All projects are already under source control. Then when I to Window -> Welcome to Xcode -> "Check out an existing project" I get the error "Unexpected HTTP status code: 404(-1). Does anyone have an idea on how to solve this please? Thank you

When you use Welcome to XCode > Check out an existing project you need to enter the github repository url as provided on the <> Code tab in github. It will look something like

    https://github.com/username/MyRepository.git

In my case I got -401 with the following premises:

  • The URL was OK
  • The user credentials were OK
  • However, the user was not approved for downloading from that repository

Using the correct user solved the issue.

I got this issue when using xcode with bitbucket service.

Not entirely sure if I changed something or bitbucket changed something but I noticed that my domain in the URI for the remote had changed in bitbucket and xcode was no longer attempting to push to the correct path.

eg.

domain/repo.git

for some reason now was:

domaincom/repo.git

again, I do not remember changing anything but perhaps something changed in bitbucket to alter how the usernames are formed?

I think my team ( username ) was domain.com and they always worked with the first part up until the first . but perhaps changes have allowed for their service to remove all dots and use the full team name ( username )

I removed and re added the remote using the correct URI and it worked.

In my case, the issue was with my bitbucket plan which had exceeded the free plan tier and was restricted to read-only. Fixed my plan in bitbucket, and the issue was solved after a while.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM