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!
Related
This is regarding Xcode 9.2. I added a framework (local Git repo) to my project, then deleted it when it did not do what I needed it to do. Now when I do a commit there is a popup with the old GIT master listed there, even though there are no source files for that repo in my project anymore.
In Xcode, in the Source Control Navigator, the unused GIT master repo was still listed there. I tried right clicking and the "Delete" option was grayed out:
I tried several command line GIT commands (found here on SO...) to clean things up but nothing had any affect.
I tried recreating the Xcode project from scratch and that unused GIT repo master still shows up in the Source Control Navigator.
I searched on SO for a couple of hours but didn't find anything regarding this issue.
So, how do you remove an unused source control master in Xcode?
I was searching around for references to the unused GIT repo and after spelunking around in the Terminal with this find/grep command:
find . -type f -exec grep -i MYREPONAME {} \;
I eventually found a reference here:
~/Library/Developer/Xcode/DerivedData/MYPROJECT
So I quit Xcode and I deleted that directory:
rm -rf ~/Library/Developer/Xcode/DerivedData/MYPROJECT
And now the reference to the unused GIT repo master is gone from my Xcode project. Perhaps this is an Xcode bug?
There may be a cleaner way to fix this problem, but this manual hack did work.
Based on Kévin Renella's answer, I manually modified ~/Library/Developer/Xcode/DerivedData/MYPROJECT/Blueprint.xcscmblueprint and just removed the offending repo along with any reference to that repo. No need to delete the whole file and risk loosing other repo references.
EDIT: Thanks #RobMac - XCode restart did solved it. Good luck for all
Looks like a bug...
I Have two files in Xcode that marked in the source control with question mark (so it's untracked files)
When I do git status i get:
On branch develop Your branch is up-to-date with 'origin/develop'.
Untracked files: (use "git add ..." to include in what will be
committed)
Podfile.lock
Pods/
The files are not listed.
I try to workaround in Xcode by right click and "Add "FileName.swift""
Or to commit them in the commit window.
Both do NOTHING!!
When I look at the repo in BitBucket I see the files in their last revision... So It's great...
The problem is only the files status in Xcode
How can I overcome this?
Thanks!
Late answer, but I had this happen to me. This is what I tried without success:
Closed existing project, not Xcode
Made changes on the command line (moved/deleted files)
Used GIT on the command line
Opened up existing project
Everything messed up
List item
I fixed it by completely closing out of Xcode and then opening up project again.
did you check ls -al?
checkout how many .git directories exist
if you have mistake you did git init more than you expect because of xocde
I while ago I removed the .git folders manually from my Xcode (5) project and switched to svn. Ever since I have about 400 missing file warnings like
file:.../.git/objects/f2/4f16e85d07b97f2953a15b302a626806530431: warning: Missing file:
.../4f16e85d07b97f2953a15b302a626806530431 is missing from working copy
Strange thing is, Xcode sees the project as a svn repository, I can view the revisions.
I think that those files are still somewhere in my project.pbxproj file.
Is there some way to remove these references automatically without destroying my svn repository? I am afraid that disabling version control from preferences will disable subversion and not fix my problem.
It is not a huge problem, but it's kind of annoying.
It's complaining about files in your ".git" folder.
Go to Terminal and "cd" followed by the path of the folder where your source code lives.
For example, something like: "cd /Users/whateveryournameis/Desktop/YourAppLivesInHere".
Then type in "ls -al .git". If you see one listed, you can remove the whole folder via "rm -rf .git".
Well turns out it was a svn problem. I had deleted the .git files, but they where still in the svn repository. Did an update, then an svn delete on the .git folder, recommitted.
The files where still reported missing for me in Xcode, so I created an empty .git directory, added it, deleted it with svn delete and restarted Xcode, the warnings are gone :)
xCode is giving me trouble, and i've been unable to help myself so far.
When I commit my project, xCode reports:
The working copy "[projectName]" failed to commit files
svn: Commit failed (details follow);
svn: '/Users/[user dir]/[path to project]/[source dir]/.DS_Store' is not under versioning control.
Funny thing is, I'm not even trying to add or commit the .DS_Store. Anyway, I tried to resolve this error by deleting .DS_Store using finder (very futile, pops up again right after killing it), and the command line (less futile, but still no luck).
Then I followed this advise http://soledadpenades.com/2009/07/02/keeping-ds_store-files-at-bay/ to add .DS_Store to my ignore list, both in the project dir and all subdirectories using
svn propset svn:ignore .DS_Store .
However, I will admit, that I did not know exactly what I was doing there. I've been using SVN for a long time on Windows exclusively with the Tortoise UI, and feel an appropriate amount of shame for not owning sufficient svn command line skills.
After the ignore, the error looks like this:
The Woking copy "[projectName]" has failed to commit files
svn: Commit failed (details fllow):
svn: File or directory '.' is out of date; try updating
svn: resource out of date; try updating
I guess that happens if you follow advise from the internet blindly without a sufficient level of understanding (shame on me).
Performing an update, didn't do anything, all files were up to date.
Because I don't want to make things worse than they are right now, I'd humbly ask for some help from you awesome guys and gals.
Thanks,
Chris
Answer
Forcing a commit from terminal. After that, using source control in xCode worked fine again.
The Mac OS stores additional information in .DS_Store. This is why you can't delete the folder: The OS needs it.
What you need is to tell SVN to ignore the folder. That's what you did.
For some reason, editing svn:ignore has the side effect that the folder gets "out of sync" (whatever that means).
The solution here is to update the folder: svn up . from the terminal. After that, you can commit the new property.
After restarting Xcode, everything should be fine again.
Try to edit the ignore list from inside Xcode next time, it might do the necessary magic for you.
I'm sort of stumbling around with an issue with Xcode 4, and Git. I'm a one man shop with multiple macs, and had my project working with Git and Xcode4, (stored on a dropbox folder), so I could share that folder across my MBP and iMac with minimal interaction. So, it was late one night and I accidentally committed my xcode project file, and then I started getting issues with UserInterfaceState.xuserstate constantly updating... Later learned that .gitignore would have been good to have in place.
Back to the drawing board and I've been trying to take the new (old) project and enable git on it with the following:
$cd path/to/project
$git init
$git add .
$git commit -m "Initial commit of project"
This works fine, now I'm back in XCODE, and add the repository, which it recognizes in Organizer. One Issue is XCODE doesn't recognize that I've modified a file, and the majority of the "Source Control" menu items are disabled, Ex: "Commit"
I'm wondering if there are a recommended # of steps to:
1) Get Git running on a xcode project that wasn't set up this way initially
2) Steps to add the Gitignore file and when
Ultimately would like the "Source Control" menu items enabled again.
I'm obviously learning some Git SCM related items with xcode 4, and I appreciate your feedback!
Maybe this isn't the answer you want but I gave up on getting Xcode4 to play well with git and just started using the excellent (and free) SourceTree. It really made my life easier.
To add Git to the project
Go to the directory and in a terminal window
cat > .gitignore
build/*
*.pbxuser
*.perspectivev3
*.mode1v3
javascripts/phonegap.*.js
Type Ctrl+D to close the file.
Initialize the Git repository
git init
git add .
git commit -m
Add the repository in organizer. Use the full directory path.
Caveat - this still does not enable Source Control menu items. But you can use git from the command line.
See other related post: Using Git with an existing XCode project
There are three ways of setting up exclude files in git. Which is easiest depends on you. But, I find that when using git to share for myself amongst multiple machines, a global ignore file works best, and I can always add more specific excludes if you need to.
Essentially
Globally, by setting up a per user or per machine exclude file
Per repository - by setting up a .gitignore file in the repo
Per clone - by setting up the `.git/info/excludes file
I've got a my global exclude file on Github if you want to see an example, including Xcode4 specific exclusions.