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?
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.
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"
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.
I solve the problem simply by this:
Add the culprit to the project
Remove the reference
This cleans the internal state of XCode and the message goes away.
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.
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
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.
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!
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.
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
I have resolved this issue by following steps:
Clear Derived Data
Discard Missing files while commit and then do commit.
Clean Build
Resolved..
Happy Coding.. :)
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"
This fixed it for me:
git reset HEAD <path-to-deleted-file-that-was-causing-the-Xcode-warning>
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!
When I click "show modified files" in my Git History
I see empty window with message "No version Editor"
I noticed, that If I commit some files and doesn't restart XCode, history of that commit will show modified files well. But after Xcode restart it becomes empty too.
My settings:
XCode 8.1
Console git commangs like git log -p, work fine.
How can I reattach repository to my project to reset it?
I have no repositories in my accounts settings:
Yes, it’s the bug for xcode to show modified files in version control history. You can vote your voice in Apple bug reporting
How can I checkout github project on xCode 5 correctly?
I have done checkout from xCode (Source Control - Check Out...). But now I can't commit any changes to the repository (Source Control - Commit...). All "Source Control" commands are disabled on the xCode except "Check Out...". But ".git" folder presents on the project's folder. What's wrong with it?
You can follow this tutorial, which describes your case after having created locally a git repo and done some commits:
The git repository is ready, but if you go back to Xcode and open the Source Control menu, you’ll find out that everything is still disabled.
That’s because Xcode doesn’t get notified automatically about our manual git repository addition.
So, close Xcode using the menu Xcode > Quit Xcode and re-open it.
Now, in the NoGitExample project if you open the Source Control menu once again, you’ll see that all options have been enabled, just like if we would have added the git repository along with the project creation.
I'm using Cornerstone 2.7.12 and Xcode 5.1. Mostly I use Xcode's Source Control menu items but in this particular working copy I'm having trouble with UserInterfaceState.xcuserstate. I can commit just fine. Then, for example, I try to switch branches but Xcode complains that I have uncommitted changes. When I commit, the only thing that's changed is UserInterfaceState.xcuserstate. So I commit. Then I try to switch again but again Xcode complains about uncommitted changes. Again it's UserInterfaceState.xcuserstate.
So I thought I'd do the switch with Cornerstone (right-click on the Working Copy -> Switch...). In Cornerstone I've added *.xcuserstate to the Global Ignores (Cornerstone -> Preferences -> Subversion -> turn off Use default global ignores -> add "*.xcuserstate") but it doesn't ignore it. I've quit and restarted.
Using Cornerstone, how do I ignore Xcode's UserInterfaceState.xcuserstate file?
Here's what I did:
in Terminal cd to the project.workspace directory
svn -v status revealed this file was under version control (M):
M 655 654 user xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate
svn delete --keep-local --force xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate
That fixed it. At that point Cornerstone showed that it was ignoring the file. And Xcode behaved properly too.
I'm having problems with Xcode's built in SVN manager.
I checked out a remote SVN repository and I want to commit the changes while I'm working in Xcode's editor. As seen on the screenshot, it shows the correct SVN flag in the Organiser window and also in the editor sidebar (M for modified etc.), but when I try to commit from within the editor, I get the error:
The operation could not be performed because no valid working copies were found.
Although commiting/updating etc. works fine in the Organiser window…
Any ideas why?
I had this exact same issue recently.
The solution for me was a simple restart of Xcode, and after that all the files were noted as being updatable via the right click "Source Control >" menu.
I encountered this myself today when trying out Git with Xcode for the first time. I created two demo projects with the "create a local git repository" option and they had the same problem. I was able to commit from the organizer window, but the main Xcode file view didn't seem to recognize git at all.
After quitting and restarting, I created a third demo with the git option, and the main window recognized the changes right off the bat - i.e showed the "M" beside a modified file.
I think Xcode subversion version is different from repositary version.
if you use other svn management tools like "cornerstone", you have to check versions.
Check subversion's version on Terminal
1.xcode subversion
/Applications/Xcode.app/Contents/Developer/usr/bin/svn --version
2.installed subversion
/usr/bin/svn --version
3.port installed version
/opt/local/bin/svn --version
check these versions and upgrade Xcode's svn binary.
This is what i did.
$ cd /Applications/Xcode.app/Contents/Developer/usr/bin
$ mkdir svn_backup
$ mv svn* svn_backup/.
$ ln -s /opt/local/bin/svn* .
and restart Xcode.