Xcode 8 - Missing Files warnings

IosCocoapodsXcode8

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

If you don't use Xcode source control but some other git client (like source tree or terminal), you can disable source control in Xcode and then the warnings will disappear.

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

Solution 3 - Ios

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.

Solution 4 - Ios

I solve the problem simply by this:

  1. Add the culprit to the project enter image description here

  2. Remove the reference enter image description here

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

Solution 5 - Ios

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.

Solution 6 - Ios

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

Solution 7 - Ios

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.

Solution 8 - Ios

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!

Solution 9 - Ios

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.

Solution 10 - Ios

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

Solution 11 - Ios

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.. :)

Solution 12 - Ios

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"

Solution 13 - Ios

This fixed it for me:

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

Solution 14 - Ios

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!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlanView Question on Stackoverflow
Solution 1 - IosmattView Answer on Stackoverflow
Solution 2 - IosmilcziView Answer on Stackoverflow
Solution 3 - IosParrett AppsView Answer on Stackoverflow
Solution 4 - IosHassan KarimiView Answer on Stackoverflow
Solution 5 - IosTimView Answer on Stackoverflow
Solution 6 - IosRahul JoshiView Answer on Stackoverflow
Solution 7 - IosCodeBrewView Answer on Stackoverflow
Solution 8 - IosPatrik ForsbergView Answer on Stackoverflow
Solution 9 - IosfreytagView Answer on Stackoverflow
Solution 10 - IosPawełView Answer on Stackoverflow
Solution 11 - IosDimple ShahView Answer on Stackoverflow
Solution 12 - IosShrawanView Answer on Stackoverflow
Solution 13 - IosFrancisView Answer on Stackoverflow
Solution 14 - IosNitin AlaburView Answer on Stackoverflow