Missing file warnings showing up after upgrade to

2019-01-08 03:08发布

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

21条回答
何必那么认真
2楼-- · 2019-01-08 03:42

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!

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-08 03:42

I solved it the following way:

  1. Check the path to the missing file.
  2. Create missing files at appropriate locations within your project directory
  3. Add them to your project using "Add Files to "project"" and create references only (do not copy the files)
  4. The warnings should disappear at this point.
  5. From within Xcode delete the files making sure you click "Delete" instead of the default "Delete Reference Only"
  6. You're done.
查看更多
beautiful°
4楼-- · 2019-01-08 03:42

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.

查看更多
爷的心禁止访问
5楼-- · 2019-01-08 03:43

Press Cmd + 7 after build and select the latest build action. Does it look like good old Xcode a bit? :) enter image description here

查看更多
走好不送
6楼-- · 2019-01-08 03:44

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!

查看更多
地球回转人心会变
7楼-- · 2019-01-08 03:46

In my case

  1. I simply open SvnX.
  2. All missing Files are marked in red. Select and delete them.
  3. Then all Xcode Warnings were gone.
查看更多
登录 后发表回答