Reputation: 17047
I recently upgraded to Xcode 4 (which is a great upgrade) but now I'm getting some warnings that I did not get before. I have looked through forums and other SO posts but have not come across how to fix this.
The warnings I get are project level warnings for a missing file. The files that are being shown have been deleted from the project navigator view (also choosing to delete from file system). However it still seems to be showing up as somehow linked to the project, even though the file no longer appears in the Project navigator.
I have looked around and not found how I can tell Xcode that these files are gone, stop giving me warnings. Here's a screenshot that I get in Xcode4, but never got in Xcode 3.
Upvotes: 166
Views: 70559
Reputation: 1832
It's very Simple,
Xcode -> Preferences -> Source Control -> uncheck Enable Source Control
and Do not forget to do cmd+shift+k
Upvotes: 1
Reputation: 17725
In my case there was an xcode Project called Sample
in the following folder path /folder1/folder2
.
There was a .git
file inside /folder1/folder2/Sample/
which is expected.
There was another .git
file in the parent directory (/folder1
) which was causing the issue. The folders might have been deleted leaving behind the .git
file
rm -rf /folder1/.git
If moving your project to a completely new location fixes the issue where there was no .git
file in the parent directories up the hierarchy then it is a clue that the above solution could work.
Upvotes: 0
Reputation: 803
I didn't have to do anything. I committed my code and pushed it up. Turned off XCODE. Pulled it down again and everything just worked.
Upvotes: 0
Reputation: 2468
In XCode 4.2.+ (possibly in 4+) you can avoid manual work and command line :
And that's it :)
All those nasty warnings are gone!
Additionally for Xcode 6+: After selecting the file view 'middle icon' - you can click the checkbox to the left and this will mark them as deleted for SVN when you next commit!
Upvotes: 55
Reputation: 31311
In Xcode5 & Xcode6, below steps worked for me
Xcode
-> Preferences
-> Source Control
-> uncheck Enable Source Control
then
Xcode
-> Preferences
-> Source Control
-> check Enable Source Control
Upvotes: 50
Reputation: 5819
I am using svn and manage to solve this problem by
svn delete pathToMissingFile
which is going to remove the local svn copy of the missing file as well as the copy in the remote repository.
or
svn revert pathToMissingFile
which is going to discard changes on the missing file which mean putting the missing file back to where it was.
Upvotes: 2
Reputation: 235
Dont delete the file directly in your .xcode folder. Delete files from xcode project navigator. (Right click on that file and choose move to trash).
Now, To clear this issue add same files in same location. And delete from the project navigator.
Upvotes: 0
Reputation: 7718
The answer by Alex fixed my issue of missing files.
I had one other problem ( though it is not related to missing files, i feel this would be the better topic)
I fixed this by going directly into the repository, create a new directory under images so that the physical folder is now in the SVN server
I then took an update of the source, and got the newly created directory inside my working copy (though it is not added to the project).
I then copied the images to that directory and added them to the project using "Add File" option, which brought me back the "A" status and I was able to check in the files.
Just wanted to share this.....because it took a lot of time from me.
-anoop
Upvotes: 0
Reputation: 109
This worked for me:
File
-> Source Control
-> Hide Working Copy Status
then
File
-> Source Control
-> Show Working Copy Status
Upvotes: 9
Reputation: 885
In my case
Upvotes: 0
Reputation: 130152
These solutions are way too difficult. The problem is that you have removed the project from filesystem but SVN still thinks they are there. Detaching project from SVN will work, the same for removing .svn folders BUT that is going to destroy your repository!
It is much easier to open console, browse to your folder ("cd /pathToYourFolder") and type the following command:
svn delete nameOfMissingFile
If the name of your missing file includes the @ character (eg: retina-specific artwork), ensure the file name terminates with the @ symbol:
svn delete [email protected]@
For GIT repositories:
git rm nameOfMissingFile
Upvotes: 297
Reputation: 17012
Disabling SVN in Xcode prevents these issues (assuming you're managing your repository with another SVN tool). See this question:
Can you disable version control integration in Xcode 4?
Obviously, this might not be practical if there are other Xcode projects you do want to use SVN with.
Upvotes: 3
Reputation: 2267
All the above didn't work to solve the same kind of issue I had. Doing some search, I understood that the issue I had was related to SVN conflicts.
I found out that there were conflicts using the command line:
svn status
Then all conflicted files had to be resolved
svn resolved filename1 filename2 ...
Once the conflicts resolved, the warnings were gone from Xcode
Upvotes: 1
Reputation: 1690
Go in to the appropriate directory and run:
svn revert fileName
Upvotes: 4
Reputation: 61
I solved it the following way:
Upvotes: 6
Reputation: 1941
I used the following way to deal with tha issue:
Launch the terminal and cd to the project directory. (ex: cd /Users/Mauro/Src/Pippero-1.2/ )
Then enter the following command:
find . -name .svn -exec rm -rf { } \;
the command will recursively search for files (and folder) called .svn and delete them
Upvotes: 3
Reputation: 8890
I also had this problem, and as user151215 has described it IS due to .svn folders.
I had a old .svn folder, not in the project itself but in the projects parent folder.
the offending .svn folder will have an entries file that contains your missing files. So you can use Teminal and search for a missing file name string, e.g. grep -lir BagController.m yourRootDevDir/*
simpler than enabling hidden files in finder, just use the terminal. cd to relevant directory, and mv .svn ~/.Trash
Hope this helps!
Upvotes: 4
Reputation: 498
It has something to do with .svn hidden folders in your project.
I solved this issue by detaching the project from svn.
a. Open terminal and type the following commands:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
This will allow you to view the .svn folders inside your project
b. Delete every .svn folder in your project folders/subfolders
c. Re-enable hidden files:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
d. Now your project is detached from svn and you no longer get build issues.
e. Re-add your project to svn or whatever.
I'm a beginner myself and this was my way of dealing with that issue, so I'm not sure this is the best way to go. Anyway, the problem was solved.
Upvotes: 27
Reputation: 63697
I had that bug and found no way to solve it other than creating an empty file on that position and then deleting it. It happened with files I had deleted from the project, and cleaning, building, deleting manually the Derived Data directory didn't work either. I believe it is a bug, and that it can be quite painful if it happens with more than a few files.
Upvotes: 4
Reputation: 6102
Press Cmd + 7 after build and select the latest build action. Does it look like good old Xcode a bit? :)
Upvotes: 0