XCode - my project is empty after I restart my Mac - xcode

I got this very weird problems these days on XCode (8.3.2 8E2002):
My XCode project is working well with Bitbucket source control. Some days ago, after booting up my Mac, all files in my project are gone, its project folder name became <myprojectname> (1). Then I cloned it from Bitbucket and was able to work on it, committed, ...
I find that every time I restart my machine, the symptom comes back and I have to redo cloning from Bitbucket, work, commit, ...
Previous XCode versions never had this kind of issue before. Has anyone got it? What's wrong with my XCode/Bitbucket? How can I fix it?
Thanks

Related

Xcode Server won't build because source control information is in an invalid format

I have XCode Server set up with XCode 6.4 and OSX Server 4.1.5. I had integrations running fine until I transferred my git repository to another bitbucket account. No big deal right? Wrong for me :(. After I transferred my repository, I changed my git remote, I changed the repository location in Preferences in Xcode on my dev computer as well as on my server. Regular git functions are working fine from the command line and from within XCode. Nothing seems wrong until I try to run an integration and then it gives me the following build service error:
Could not check out sources because the source control information is in an invalid format.
I tried deleting my bot and creating another one. I tried cloning my project straight from the new location into another folder in case something had gotten out of sync. I git reset hard to the remote branch just in case even though there was nothing different. I tried cleaning and restarting everything multiple times. I reset XCode Server too (sudo xcrun xcscontrol --reset) and am still getting the error making me think I really did somehow mess up my git repository as far as XCode is concerned, but I have no ideas about what XCode doesn't like about my source control information. Does anyone have any ideas for what I can do or try? I've been tearing my hair out for hours.

Xcode 5: The repository could not be reached

I have this issue with Xcode 5 where I'm trying to commit a file to a remote git repository (BitBucket) and getting a pop up window with the following error: "The repository "project_name" could not be reached. Please verify that the repository is online and reachable and try again."
I've been working with this setup for awhile now (since Xcode 4) and didn't have any problems with it. Under Xcode->Preferences->Accounts->Repositories I saw the correct repository, but duplicated. I deleted and added it again, but it didn't help. I tried closing the project and rebooting the computer and it didn't help either. I can see the project's history under Source Control->History. I can access the repository on BitBucket.
Any idea where this is coming from and how to solve this issue?
Not sure if this helps in the tracking down of this problem, but here goes anyway:
I have been connecting to a local network git repository perfectly well for a number of months, but I encountered this problem later yesterday and nothing I did seemed to improve the situation. That included:
Rebooting both the development machine and the server;
Reinstalling Xcode from the App Store;
Re-cloning the project from the git command line (which could see the repository perfectly well);
Checking out the repository from Xcode (I was able to check out but every other operation, such as , Commit, Refresh Status etc. seemed to cause the problem...)
Manipulation the repository with SourceTree (which could also see it fine).
Eventually I stumbled across a solution to my local issue. If I launch Xcode with a wired and wireless network enabled then I can't see the repository. If I close it, disable wifi and relaunch it then I can.
I've not had much opportunity to work out what the difference is (especially as the wifi connects to the same network and is the secondary choice for networking) but it does seem to fix it.
Hope that might help others and hopefully I can find a real explanation soon!
Dave,
Well it seems this had nothing to do with Bitbucket.
The problem was a messed up .git folder on my machine.
My project resides in a Dropbox folder. Somehow, perhaps because of accessing it from different machines, it created copy/duplicate files in the .git folder and it messed up Git. After fixing all the conflicts Git returned to working as usual and I was able to commit from Xcode to the remote repository.
Now, if you encounter this issue, you might not have the same setup as mine or work on Dropbox or any similar service, but I strongly recommend checking your Git folder thoroughly. Good chance something is messed up there.
Check internet connection of system.also quit xcode and reopen it.

XCode 5 - the local git repository could not be reached

I created a project with local git repository using XCode 5 (preview 6), made some changes and tried to commit, and finally got the message "The repository 'HelloWorld2' could not be reached, please verify that the repository is online and reachable and try again".
The same message is also shown when the Refresh Status menu item under Source Control menu is clicked.
Actually, I have XCode 4.5 installed and run side by side with 5.0, but the issue does not exist when the project is opened using Xcode 4.5. Also, the commit action works fine as well via command line.
Not sure if this helps in the tracking down of this problem, but here goes anyway:
I have been connecting to a local network git repository perfectly well for a number of months, but I encountered this problem later yesterday and nothing I did seemed to improve the situation. That included:
Rebooting both the development machine and the server;
Reinstalling Xcode from the App Store;
Re-cloning the project from the git command line (which could see the repository perfectly well);
Checking out the repository from Xcode (I was able to check out but every other operation, such as , Commit, Refresh Status etc. seemed to cause the problem...)
Manipulation the repository with SourceTree (which could also see it fine).
Eventually I stumbled across a solution to my local issue. If I launch Xcode with a wired and wireless network enabled then I can't see the repository. If I close it, disable wifi and relaunch it then I can.
I've not had much opportunity to work out what the difference is (especially as the wifi connects to the same network and is the secondary choice for networking) but it does seem to fix it.
Hope that might help others and hopefully I can find a real explanation soon!
Dave,

XCode Won't Commit To GIT

Been googling for a while with no luck.
I have been working on my app for a week and I'm trying to commit to git now, so I can start branching and try some new stuff. But I can't commit my changes. I get the following message:
"The working copy "APP NAME" failed to commit files.
fatal: Could not switch to '/Users/Leonne/Documents/iOS Projects/APP NAME/APP NAME/Resources': No such file or directory"
I have initialized the git repository. I don't understand what could be going on.
Before, I did create a "Resources" folder, but deleted it afterwards. I never committed with the existence of this "Resources" folder. I deleted the Resources folder because it was giving me troubles whenever I tried to compile my app. I'm working with XCode 4.4.
Any help will be appreciated.
Ok, I just experienced this problem today morning. I don't know if mine is THE perfect fix. My Mac crashed and I restarted, and I could commit again.
If my fix hold true with you as well, then it could be a bug with XCode.
Edited
It seem my error still exists and the following is my fix.
It seem Xcode GUI have some problem with using GIT properly. So i used the terminal to do this. I went to the working directory and then did a git status this will show you a list of files that were deleted/modified/added. You can manually add them all together using git add or just a straight git commit -a (not recommended on complex projects)
This solved the commit issues and when i went to Xcode, the error doesn't seem to exists anymore
Looks like I have the bad habit of solving my hour-long problems 5 minutes after I post about them on StackOverflow, haha.
My fix was rather easy. I navigated to the specified route and re created the Resources folder. I added the folder to my project via XCode's "add files" feature. Directly afterwards I deleted it from there, moving it to trash. Now I can compile and commit, thank goodness.

Xcode 4.0 hangs on loading project due to the corrupted repositories?

I was trying to commit some changes, Xcode was hang on bringing up the changed files. So I killed (Force Quite) the Xcode. Then next time when trying to bring up my project, Xcode just hangs on loading project. Firstly I thought that maybe my project file was corrupted, but it still the same behavior with my backup project file. So I guess that the default repository for my project is corrupted.
The question is - where is the location of the default repository for my project? can I "remove" it to see if Xcode can starts up properly w/o it?
In XCode 4, you'll find the output contents for the project ~/Library/Developer/Xcode/DerivedData
I'm having this issue as well, intermittently with several projects. I suspect Lion resume as at least part of the culprit as I've had some success with deleting the content at:
~/Library/Saved\ Application\ State/com.apple.dt.Xcode.Lion.savedState
I'm presently reinstalling Xcode to see if that clears things up. A very Windows thing to have to do, eh?
[Sorry for hijacking such a dated thread.]
When we stumble upon this issue (it happens a lot lately) we usually remove ~/Library/Developer/Xcode/DerivedData/YOURPROJECT_RANDOMSTUFF and restart Xcode.
Usually the hang comes along with Xcode using all available RAM and causing the machine to swap heavily.

Resources