Xcode 4 + SVN = working?
I have a VPS with Centos running. I have setup subversion on the VPS. While setting it up in Xcode, Xcode reports that everything is fine. When I import a project however, Xcode gives a warning:
Authentication realm: <svn://**********.net:3690> **********-********** Password for 'svn': Authentication realm: <svn://**********.net:3690> **********-********** Username: svn: Can't read stdin: End of file found
I can’t even create directories, but Xcode reports that it can connect to it fine. I have put in the correct user name and password.
I am able to get a third party plugin working in visual studio working at the same address so I know it’s not the server that’s giving problems. I’ve uploaded some files using visual studio.
Has anyone got subversion working in their xcode 4?
10 Solutions collect form web for “Xcode 4 + SVN = working?”
I solved the problem this way
1.open a terminal
2.type ‘svn list svn://~~~paths‘
ie. “NJW-Mac:~ bluepin$ svn list svn://192.168.0.184/BMA“
3.You will need to enter PCUserPassword,svnUserID,svnUserPassword
4.U should see output from the svn list command which means you were able to connect to the SVN server
5.return to xcode4
6.try again your job(connect Repositories)
If u access your SVN repository from the terminal once it should allow you to connect to the repositories using Xcode (I suspect the subversion credentials have to be cached somewhere).
Ever since I started using Xcode I’ve had no problems connecting to my subversion repository using an ip address instead of the hostname. eg. http://192.168.1.xxx/svn
When Xcode 4 came out for Snow Leopard, it worked fine as well. But since upgrading to Lion and the updated Xcode 4, whatever I did it refused to connect to the repository. I could connect without a problem from the shell with ‘svn list http://192.168.1.xxx/svn‘, but not from Xcode. I tried removing the password from the repository. That didn’t work so I put the password back in.
I tried removing any references to the repository from my keychain, but that didn’t work either. It wouldn’t trigger an authentication window in Xcode. Using ‘svn list http://192.168.1.xxx/svn‘ from the shell gave me the authentication window, and it connected successfully. It added an entry into the keychain, but Xcode still didn’t work. I tried adding Xcode to the access control list for the new keychain entry, and that didn’t work either.
I found another thread here with a small comment about adding an entry for the svn server to the /etc/hosts file, so I thought I’d give that a go.
After adding this line to the hosts file, everything started working perfectly in Xcode using http://Subversion/svn to connect to the repository. Connecting from the shell worked fine as well.
It’s probably worth mentioning that the new keychain entry shows 2 entries in the access control list for svn. One entry pointing to /opt/local/bin/svn, the other to /Developer/usr/bin/svn. After restarting Xcode, it requested access to the keychain. Now there is a third entry in the access list for Xcode. I tried adding these 2 entries that were added by Xcode to the access list for the keychain entry using the ip address, but Xcode still didn’t work.
Over the years I’ve seen some strange behaviour in OSX when authenticating to devices using an ip address. My web browser would sometimes find the keychain entry for my router when accessing it using an ip address, and other times it wouldn’t. So to avoid all the wasted hours trying to diagnose these sorts of problems in the future, I’ll be using the /etc/hosts file from now on.
Seann is right, it was an issue that the SVN credentials hadn’t been cached in an “Xcode 4-friendly” manner.
This fixed it for me. Basically, what I had to do was:
- Close the project I’m trying to commit in Xcode.
- Open a terminal to the root folder.
svn cleanupto remove any locks.
svn commitwith either
-m "Commit message here"or
--editor-cmd=anEditorIUse. I used the latter, because I like
- Save the text file and quit if you’re using an editor.
- Enter your account password for OS X.
- Enter your SVN username.
- Enter your SVN password.
If command line svn uses KeyChain (default on MacOS) and sill ask you about svn password this could be an solution:
- Suppose you are OK with
~/.subversionconfiguration folder (default settings, backup and delete folder to be sure)
- In ‘login’ chain find passwords containing ‘svn’
- For passwords which match your server dbl-click and in “Access Control” allow access without confiramtion (I do not know exact names of UI lables in English MacOS).
- Command line should stop asking about password, Xcode4 will fix also.
Having just spent the morning fighting with XCode and SVN, I think I have a solution that does not require using any terminal prompts. This is for connecting to an existing repository.
- Checkout or Clone Repository
- Enter host location
- Supply the name and select Subversion for the type
- Select the local destination folder and click Checkout
- Enter username and password when prompted
- When the failure message appears indicating access was denied, click Try again
- Click Checkout on the prompt for the local destination folder without changing anything
- Select replace on the confirmation of the folder.
Done. It seems to require two connection attempts before it works. I’ve tried this on a couple different computers now and it’s worked every time.
Credit to “makdiesel” who actually found this solution (which was the only one that worked for me)
Open your /etc/hosts file and comment out the IPv6 lines (sudo vi /etc/hosts):
Clear the dns cache (sudo dscacheutil – flushcache)
Re-start Xcode and your SVN repositories should be working again.
I had a similar problem; was working in XCode 3 blah blah…
I followed all the instructions here and here but still it was hanging.
The problem was that my svn username and my mac OS username and password were the same. Once I’d changed the name of my svn user it worked!
Hope this prevents anyone else spending a day’s work on this
I had this problem when I moved my SVN server from one box to another. Xcode refused to accept the credentials added onto the repos page.
The solution I found that worked was to remove the repo from the list, quit Xcode, then open the source-controlled project again.
This then correctly prompted me for the SVN password. After this, it all worked fine.
I you have checked out the project already, just remove the repo Organizer and open a terminal with the project directory.
This will ask for the svn credentials and svn integration for this project should work in Xcode now.
NaJeWang‘s answer pretty much nails it, but for me it was as simple as
- Entering my user password for my machines user account.
- Entering my user name for my svn account.
- Entering my password for my svn account.
And that did it!