Xcode 8 - Missing Files warnings

本小妞迷上赌 提交于 2019-12-17 10:15:28

问题


Ever since upgrading to Xcode 8 using Swift 2.3 I have several missing files warnings. They are all related to pods that I am using.

The files that are missing are

*.xcscheme 
*.cpp
*.xcuserstate
*.swift

The pods that are showing missing files are

  • Realm (~38 of 43)
  • TextFieldEffects (~3 of 43)
  • BEMCheckBox (2 of 43)

How do I fix this issue?


回答1:


This is just an Xcode bug. If you delete or rename a file without then doing a commit, Xcode sees the discrepancy between the previous git commit and the current state of things and reports these warnings. They go away as soon as you do a git add that includes the file deletion / rename.




回答2:


If you dont use xcode source control but some other git client (like source tree or terminal), you can disable source control in Xcode and than warnings will disappear.

Xcode > Preferences > Source control and uncheck "Enable source control"




回答3:


I tried all of these (and many others) but none of them worked. After hours of trying various fixes, I found that the following procedure worked.

cd "project directory"
git add .

You will need to close XCode and reopen or future Commits may fail.

Hope this helps someone.




回答4:


I solve the problem simply by this:

  1. Add the culprit to the project

  2. Remove the reference

This cleans the internal state of XCode and the message goes away.




回答5:


How about commit in Source Control.

You may firstly have to show Packet Contents of "your project name".xcodeproj and show Packet Contents of project.xcworkspace and then delete the xcuserdata folder.

If you still cannot commit because of Couldn't communicate with a helper application problem then under your project directory try the following:

xcrun git config user.name "Your Name"
xcrun git config user.email YourEmailAddress

*Remember to reopen the project to see the effect.




回答6:


You can resolve the issue by checking "Add and Remove files automatically" option in X-Code->Preferences->Source Control

Here is the screenshot of Preferences




回答7:


Xcode 8 seems to often miss git add the deleted/related files. To correct it, tap Commit... from Xcode's Source Control menu, make sure to check these files (which are followed by an exclamation mark !), then commit the changes. This should clear the warnings.




回答8:


I've had this problem a few times now and finally I had it after doing ugly workarounds! I sat down and tracked it until I found the reason to it and were the references are stored!

As someone already proposed it has to do with version control, well yes and no, in some cases, it definitely have to do with poking around with files directly using the finder or whatever (but not from XCode)

Here's a quick fix that saves a lot of trouble and swear words!

Delete this file: ./.xcworkspace/xcuserdata/.xcuserdatad/UserInterfaceState.xcuserstate

And the errors go away!




回答9:


I had the same problem. In my case there was a .git directory in a parent directory of my project. By deleting that parent .git directory, the errors where gone.




回答10:


In my case Pods where checked into the repository generating a couple hundred warnings for "missing files". Fixed it by removing Pods from the repo :

git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all



回答11:


I have resolved this issue by following steps:

  1. Clear Derived Data

  2. Discard Missing files while commit and then do commit.

  3. Clean Build

  4. Resolved..

Happy Coding.. :)




回答12:


I have faced the same problem after adding custom CollectionView cell(CustomCollectionViewCell) in the project.Same error occurred as above. No need to delete the file instead we can.

Rename Missing file for me it's "xCustomCollectionViewCell.xib" .

Now the error is gone.

Again rename the same file to original name "CustomCollectionViewCell.xib"




回答13:


This fixed it for me:

git reset HEAD <path-to-deleted-file-that-was-causing-the-Xcode-warning>



回答14:


I had this issue on Xcode 9.3

The solution that worked for me: Add a space in the file, save, then wait for the ! status to change to M, and delete the space, save.

Sadly, with nearly a 100 files to go through, I revisited this post, and this comment from @BennyTheNerd to an answer, helped!

For me, it was as easy as quickly disabling and then re-enabling source control under preferences. Xcode > Pref > Source Control > uncheck "enable source control" .... then re-enable it after. And poof! gone! – BennyTheNerd Jan 16 '17 at 7:29

Additionally though, I had quite Xcode and then open the same project, and then re-enable source control through preferences.

Hope this helps!



来源:https://stackoverflow.com/questions/39711061/xcode-8-missing-files-warnings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!