I have a Git repository where my project is linked to. It is located somewhere like /Users/a/Documents/Xcode Projects/MyProject. I use Xcode's UI to commit changes and it worked perfectly for a couple of times. But now, out of a sudden, I get this error when trying to commit new changes:
The working copy myproject could not be reached.
Please verify that the working copy is reachable and try again.
As you can see, the message shows my project's name in lowercase and when I check the Repositories in XCode (File - Source Control - Repositories...). I see there are two, apparently identical, repositories (they both link to the same Origin), but one with the name all in lowercase.
The correct one location is /Users/a/Documents/Xcode Projects/MyProject as I told you. But the duplicated one is supposed to be located in /Users/a/Documents/xcode projects/myproject which, of course, does not exist.
Does anybody know why is this happening? Can anybody help me to delete this duplicated repository and make my project link the correct one? So I can keep using the XCode's UI to commit changes in my code.
I found that Xcode 4.2 can behave in two different ways depending on what exactly you select in the File->Open dialog, when opening the project from within Xcode:
The .xcodeproj file
The project folder (containing the .xcodeproj file)
Selecting 1 or 2 and pressing enter wil give me two different repositories with different paths in Xcode's Repositories, so sometimes it helps to close the project, delete both repositories and then open the project in "the right way", say 1 or 2.
I had the same problem. You probably clicked the recent opened project offered at the beginning of Xcode screen. I chose to open the project/workspace from manual selection in the file system and it solved this duplicated working copy issue. Hope it could be a help.
Related
I have renamed my project name, And it is working fine to me and building successfully. And I committed these changes to my Server, other person working on same project with different branch.
So, Once he got pull from server xcode asked him "Revert" or "Keep Xcode version", we selected revert option, then code project name came as red colour and files not showing.
We tried somany ways to fix this, we are not found any solution, can anyone suggest us to fix this issue.
For renaming app name,
I have just renamed the appname.xcodeproj in left panel of xcode and then created new scheme.
We are using Gitlab source control.
I will suggest to take a new clone.
When you are adding complex project structural/configuration level changes, then it is always better to take a new clone to avoid the misleading behavior. Merging the remote code will create a conflicts with local project workspace and behavior may weird.
We are working with building ETL packages in SSIS using a TFS repository. When my collegue add new files to the repository they are not added properly to the repository even though he checks in the entire project file. He sees the files in his project folder, and it looks like everything is checked in. But when I click on "Get latest version" I get a warning that the package is missing from the project directory. If any of us then try to add the file again we get a warning that the file all redy exists, even though it is not visible in my folders. Right now the solution we are using is for him to delete the file and then commit the change. After he deletes the file I get the latest version. Then he sends me the files and then I add them to the repository. Once I have added the files things seem to work as expected. Has anyone else had this problem, and know of a solution?
UPDATE:
The solution we found now is that I have to go to the local folder and find the new file my colegue added. Then I right click the file he just added and select add to project. Then the new file is visible in my version, but it does not have a blue lock icon next to it. If I then double click the sln-file to reload the project the blue lock icon is visible to me.
It is still not an optimal solution, but it works a lot better than him having to send me the file so I could check it in.
Is this the way TFS is supposed to work?
Can you please check the mapped work space path in your local machine there you will find the checked code. You need to manually Add.
Right Click on SSIS package -->AddExisting Package--> Select the package from Workspace-->Ok
Now you will find the missing package in your Solution Explorer as well.
If you are using TFVC.
Open Source Control Explorer=>Right click that solution/project folder=>View History, then check the related ChangeSet whether he add the file correctly.
Let your college to check the permission of that folder/file: Right click the folder/file->Advanced=>Security.
Regards
I just merged one of the feature branches into develop branch, and since then, when I open Xcode, the .xcodeproj file seems lost, all files in the project navigator are gone also. click on the .xcodeproj file I get the following alert: The file couldn’t be opened.
This is although I am adding .xcodeproj to the .gitignore file across all the branches. Have you encounter such situation?
This might be caused by unresolved merge conflicts. In that case the XML structure is broken, so Xcode can't read it.
In that case you can try this:
In finder right click on the .xcodeproj and choose 'Show Package contents'.
Open project.pbxproj in an text editor (this is the actual project file, and has to be valid XML)
Check for merge conflicts (look for <<<<<<< and >>>>>>>) and manually resolve them (be careful!), and ensure the file has valid XML format
Save the file
Try again opening the .xcodeproj with Xcode
There might be better ways of resolving the conflicts, but this worked for me multiple times.
You also might want to check out this question: How to resolve merge conflicts in Git?
Basically, in a project if more than one developer are working and one developer has added some files(it may be .h,.m or any .png) and commits the project including .xcodeProj in source control management.
But due to some reason developer removes files or images from the project and also removes the use of those files or images from the project but forgets to commit the.xcodeProj project file.
If another developer checks out from the source control management and runs the application,he would get error messge error:path file/image name:No such file or directory.
So to avoid the error to run the application at our end successfully we can follow below steps
Right click on projectname.xcodeproj and click on showpackagecontent.
There we will get another file as project.pbxproj.
Open that file on text edit and remove the lines where the file or image has been mentioned.
Save the file.
And finally run the application it will work.
I know this is an old thread, but I had this issue today. I initially shrugged this answer as I don't have multiple users on the project, but I:
right clicked on the .xcodeproj and chose 'Show Package contents'.
From here, I noticed I couldn't open the project.pbxproj. I 'didn't have the necessary permissions', so I...
changed the permissions on the file to everyone can read/write, and then I was able to open the project without issue in Xcode.
not sure where this got crossed for me, but in case anyone sees this and has a similar issue and it's not a merging conflict.
Faced with the fact that the above methods did not work for me, my reason was this: when merging two files, the structure inside of project.pbxproj file overlapped and was broken, all I did was again thoroughly scan the conflicting sites for the correct syntax {some code} , availability ';' etc.
This is an issue in XCode in which the built-in source control feature is unable to load the repository for projects located within a directory named with ALL-CAPS, such as ~/Documents/CODE. Running XCode 4.0.2 on a 2008 black macbook. If anyone has insight, please share.
This was the issue.
I create a new project, save it to the directory ~/Documents/CODE/...here-or-a-subdirectory-therein, making sure to check the "create local git repository" checkbox. I make a small edit to the AppDelegate or any other file, and Source Control commits will not work from within XCode. From the command-line, I see that .git was created in the project directory, and that the 'first commit' occurred. I can perform git commits from the command-line.
Possibly related issue: In Organizer->repositories, all my repositories have the yellow stoplight icon (even those I've gotten to work).
This was the Error:
When I try to commit from the project window (File-->SourceControl-->Commit, type a comment, and press commit) I get the following error:
The Working copy of "MyProjectName" failed to commit files.
fatal: '/Users/myUserName/Documents/CODE/MyProjectName/MyProjectName/MyProjectNameAppDelegate.m' is outside repository.
Over in the Organizer, I select MyProjectName (with the drop-down arrow and icon of the repository safe). The location is displayed as /Users/myUserName/Documents/CODE/MyProjectName/
But in the area where the commit comments are normally displayed, I see the message:
Unable to load revisions.
The likely cause was that XCode was internally identifying the Project directory as ~/Documents/Code, not ~/Documents/CODE.
One way to resolve the issue was to rename ~/Documents/CODE to ~/Documents/Code, then in Organizer (select the Repositories Tab) I deleted the repository listing for MyProjectName.
NOTE - Only removes XCode's reference to the repository, the actual repository remains intact. Now Close XCode and Reopen it. Open the project MyProjectName. XCode will recreate a reference to the Project with the correct Capitalization. Note that the renaming of the directory seems to force XCode to recognize the new directory name when the repository is recreated.
Another way to resolve the issue is: within XCode's Organizer window (select the Repositories Tab), delete the reference to the repository. Then, still in Organizer, select the "Projects" tab at top. To the left of the project's window is a list of all the projects...select MyProjectName. Now in the center frame is a field named "Derived Data" with a path to your project. Click the little -> arrow to the right of the PATH to open up the Project's Internal Settings Directory in Finder. Open the file called "info.plist" and edit the key "WorkspacePath" such that it's value EXACTLY MATCHES the location of your project (correct the capitalization of the directory if necessary). Save, and return to Organizer. Close XCode. Reopen XCode and the repository reference will be recreated. You can go directly into Organizer now, select the "Repositories" tab, then select MyProjectName's repository. You'll see the commit messages there (even if you haven't committed yet, you'll still see the auto-generated 'first-commit' that occurred internally when your project was created).
I just ran into this problem. Luckily, restarting Xcode did the trick for me.
You should probably consider using i case sensitive HFS Volume for your source files.
This way you avoid name clashes like the ones you see.
You could try and create a disk image using a case sensitive filesystem and see if your problem persists.
I had similar problem and the problem in hidden .git folder.
I added external class which I cloned from git repository and when I was adding files to my XCode project I accidentally added hidden .git files.
When I removed them everything started working correctly.
I had the same issue. You must to remove this problem file from project (only reference) and then return it back.
Happened to me that the little checkboxes next to the files in the commit window were all deselected. I selected them and this error came out.
Restarted XCode and it was the same but I noticed that the Commit button was enabled although the files were still deselect.
Tried it and it was successful...
Sometimes XCode is so strange
I have a couple of projects that I had started under Xcode 3.2.x some time ago. I switched to Xcode 4 a few days ago and want to make use of the Workspace feature as both projects. Basically, my plan is to extract some common features out of the two projects and make them a common library that both projects depend on. However, before I even get to the tricky bit of dependencies I get stuck just adding my two projects to the workspace.
I tried creating a new workspace and selecting "Adding files to " from the context menu; I then select the .xcodeproj file from my first project and it appears in the left-hand side tree browser in my workspace. However, it's just the file, not the project that I get. That is, rather than getting a two-line entry in the tree browser where the first line states the project name and the second line says something like "1 target, iOS SDK 4.3" like in the Apple documentation, I get a single line simply stating the name of the .xcodeproj file including the extension. There is also no triangle on the left to expand the node. It's like I just dragged some file in the workspace, not a project. The same goes for the second project.
I have also created a new Project "Foo" from scratch in Xcode 4 and added it to my workspace, with the same result. I looked at Apple documentation and watched the 16 second video about a dozen times now, but cannot work out what I am doing wrong (if the problem is indeed in the chair and not in the computer).
I had this exact same problem. I think it stems from having another workspace already open referencing the project you want to add. I got it working by:
shutdown xcode completely
double-click the workspace to launch Xcode and open just that workspace
drag and drop the project file from the Finder
Worked fine. I have many workspaces all referencing an openssl project, and it seems to work OK when you only have one workspace open at a time in Xcode.
Actually, I made it work without exiting Xcode.
All you have to do is make sure the projects you want to add are closed, since Xcode is having trouble adding open projects to a workspace.
So:
Close the projects you want to add
In the Workspace window, choose "Add Files to MyWorkspace"
Add the .xcodeproj file of the project you want to add
I had the same problem. SO I just exit xcode, restart it. Then I can see the files under the project.
Exiting Xcode completely and then double-clicking the .xcodeproj file to open the project.
It works but when you add an activity to the project than r.java file is automatically removed and errors are coming.