Missing file warnings showing up after upgrade to Xcode 4

70,278

Solution 1

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

Solution 2

In XCode 4.2.+ (possibly in 4+) you can avoid manual work and command line :

  1. Select project Project Navigator (Command - 1)
  2. Choose File - Source Control - Commit menu
  3. In the left pane, on top of it you have three icons, select the middle one - File view
  4. You will see the list of all missing files
  5. Select all of them and right-click - Discard changes. This will restore all deleted files from the SVN server and place them in your local SVN folder
  6. Drag and drop those files into the XCode project (Choose Sort-Date Modified in Finder to easily find them)
  7. Delete those files properly through XCode (select files and choose right-click Delete)
  8. Commit the project

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!

Solution 3

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

Solution 4

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.

Solution 5

This worked for me:

File -> Source Control -> Hide Working Copy Status

then

File -> Source Control -> Show Working Copy Status

Share:
70,278

Related videos on Youtube

Scott
Author by

Scott

I'm the CTO at a startup doing video analytics. #SOreadytohelp

Updated on April 10, 2020

Comments

  • Scott
    Scott about 4 years

    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.

    Missing file warning Xcode 4

    • sudo rm -rf
      sudo rm -rf about 13 years
      If I were you I'd always import your files into your project instead of just keeping a link to them on your disk. It really saves you from headaches if you move files around later.
  • Scott
    Scott about 13 years
    Ya, it looks like the old XCode, but it doesn't solve the problem with the new XCode saying that I have missing files. I like the view, but this seems like it's just masking the issue with XCode.
  • Scott
    Scott about 13 years
    Sad, was hoping there was an easier way around this issue. I have about 20 files, so creating then deleting is going to be quite a pain.
  • ReachWest
    ReachWest about 13 years
    I had the same issue and resolved it via Terminal using: svn rm --force nameOfMissingFile
  • Sulthan
    Sulthan about 13 years
    delete, remove, rm - they all do the same thing :)
  • jowie
    jowie almost 13 years
    This is a better answer than the one marked as correct. Deleting SVN folders from a project under SVN control can be a whole world of pain. Best to use SVN to solve the issue. I followed this answer to resolve my own problem, however I had the luxury of Cornerstone. But otherwise cool. Thanks :)
  • jowie
    jowie almost 13 years
    Not a good idea to go around messing with SVN hidden folders and files, you could end up in a tangled mess of SVN. Best to use the svn delete command to tidy up missing files.
  • gonzobrains
    gonzobrains almost 13 years
    this didn't work for me, but going into each directory and deleting the individual .svn folders did. so big ups to you, my man!
  • Yenyi
    Yenyi over 12 years
    This doesn't seem to be working for me. I would add the file back, and then delete it, but the same warning still shows up in the build. I even tried to add the files back to the project and then delete them. Still the same problem.
  • JasonD
    JasonD over 12 years
    This worked for some of my files, but not all. In the end I needed a combination of "svn delete", "svn revert" on a few other files, and then finally some cleanup in Organizer for my SVN repository (discard changes in Organizer for my SVN repository got the last two problems resolved).
  • Maciej Swic
    Maciej Swic about 12 years
    It worked for me, but i first had to create a dummy file there before i could delete if using svn. So you have to do touch nameOfMissingFile and then svn delete nameOfMissingFile --force
  • Scott
    Scott about 12 years
    This is the path I actually ended up taking. Yes it deletes all the saved SVN information, but that was actually something someone else had put into a particular project that I did not want to keep. I wanted to start fresh and didn't care about maintaining the particular versioning.
  • Twilite
    Twilite about 12 years
    I additionally had to quit and kill xcode for the problem to go away.
  • JHHoang
    JHHoang about 12 years
    I just "killall Finder" by relaunch it. The problem is gone now. Thanks
  • Dan J
    Dan J about 12 years
    Quitting and restarting Xcode solved this problem for me. My underlying SVN repository was all fine, but the Xcode tracking of my Repositories had got in a bad state after doing some additions and deletes.
  • occulus
    occulus almost 12 years
    Disabling SVN entirely in XCode is a good solution to this problem (if you don't need SVN for another Xcode project): stackoverflow.com/questions/5466254/…
  • DenVog
    DenVog almost 12 years
    If you use a GUI tool like Versions to manage your repositories, you can also do delete the offending files via the Project browser.
  • avance
    avance over 11 years
    Also, using svn, if you have @2x.png files, svn will choke on the at sign, since it thinks the @ is a version signifier. Add an @ at the end to solve this issue, e.g.: svn delete [email protected]@ --force
  • jfischer
    jfischer over 11 years
    I thought it would be sufficient to delete files in Xcodes (4.5) Organizer / Repositories. It isn't! Had the same error and this answer solved it
  • Darren Reely
    Darren Reely over 11 years
    Only needed upto step 5. I didn't actually have the files in SVN.
  • Alex
    Alex about 11 years
    In this case, go to Terminal and to the root of your project. Create the folder with "svn mkdir name_of_the_folder". Drag & Drop files with Finder from the name_of_the_folder to your Project (or folder it self to add all files). Problem is when you create folder without "svn mkdir" folder is not added to the SVN.
  • danfordham
    danfordham about 10 years
    I had refactored a project, which affected another project cos of some shared code, and XCode was complaining about missing files, related to SVN. Took me a while to figure out it was an SVN issue, after manually trawling through the project source xml and finding nothing.
  • mavericks
    mavericks over 9 years
    I had 400 file missing, but fortunately, in same folder, So I used: svn delete FolerName, All thanks to @Sulthan.
  • MajorHavoc
    MajorHavoc over 9 years
    I do not understand this. If I delete a file IN XCODE, and tell it to toss it in the trash, why should I ever get this error? Given that SVN is part of Xcode, does it not know what the hell it is doing? I now have 96 files (way too many to delete one at a time with an SVN command) because I no longer needed then, and deleted then IN XCODE. SIGH!
  • definitelyokay
    definitelyokay almost 8 years
    Works for XCode 8, just had to restart it after fixing the repository. Didn't realize rearranging things in Git was the issue, thank you!
  • zirinisp
    zirinisp over 7 years
    In my case it was a directory and I had to do "git rm -r <Directory>"
  • Bob
    Bob about 7 years
    On Xcode 8.3.2, this worked for about ten minutes and then all the warnings came right back :(