Xcode: issue "file xxx.png is missing from working copy" at project building
Solution 1
The warning will disappear as soon as you commit your changes (Xcode 8).
Solution 2
It seems that this problem may have different causes, but it's often in relation with source control software.
In my case, I solved it by going to Git, and adding the files again. I mean running the following command:
git add .
Solution 3
You can also disable source control by unchecking
Xcode -> Preferences -> Source Control -> Enable Source Control
if you're managing it via command line or any other app.
Solution 4
In XCode -> SoureControl:
Update
+ Refresh Status
did it for me.
Solution 5
In my case, the file was missing from the source control.
To fix, I had to discard this file (be careful only discard the missing file not all your project):
- Xcode->Source Control->commit
- Right Click the missing file
- Choose Discard Changes
Iban
Updated on July 08, 2022Comments
-
Iban almost 2 years
After deleting/adding some png files to project, i have got messages when building project.
"file ProjectPath\aaa\xxx.png is missing from working copy."
All these files are in the project, and the application is running. However, these messages are annoying. Looked .plist file, but there is no mention of these files. What should I do to remove these messages?
-
Shrawan almost 7 yearsCan refer stackoverflow.com/questions/39711061/…
-
-
Iban over 9 yearsThanks, but they are not in the Build Phases, and cleaning build folder does not help too.
-
Android3000 about 8 yearsI'm thinking this may be due to images having "@" in the filename, such as the "@2x" and "@3x" convention. SVN uses that symbol for revision syntax (to escape it when working with SVN in the command line, you simply add an "@" at the end as the last occurrence is the one it uses to try and determine revision info). Simply running Update worked for me. When I added some new images, I actually had to manually select "add" on the 2x/3x variants in the File Inspector pane as well. Weird.
-
Chrissi about 8 yearsYes, this happens when you delete something from a project under version control when it is still referenced by version control (in my case, svn). Using "svn update" to restore the missing files, then deleting them the proper way using "svn delete", made the issue go away for me.
-
Warpzit over 7 yearsThis! so Important. The issue also comes if you rename a folder containing files. In other words, xcode gives us warnings because we haven't commited our code yet! clap clap clap
-
Chris Livdahl over 7 yearsFound that I just had to commit my changes under git after moving some files to a different directory.
-
Alexander Vasenin over 7 years@LearnSwift Clean Cmd+Shift+K, delete ~/Library/Developer/Xcode/DerivedData/*?
-
Dan Ross over 7 yearsAfter installing Xcode 8 and upgrading the code to swift 3 I ended up with over 300 issues that needed syntax corrections (massive project). Instead, I restored from a backup and upgraded to swift 2.3 ... all went well except for a bunch of these 'missing' messages. This command worked like a charm - I'm back in business!
-
Learn Swift over 7 years@AlexanderVasenin neither
-
jaytrixz over 7 yearsThis worked for me. I had to close Xcode and open the project again and run.
-
charmingToad over 7 yearsFor me simply staging changes was enough. Good to know.
-
Sebastian Sastre over 7 yearsThis is what worked for me. The issue started when I removed what I used to had in Pods in favor of Carthage
-
Shardon over 7 yearsThis works for me too. It seems that the file is under source control and git needs to get updated also.
-
Blind Ninja over 7 years@LearnSwift you are not alone my friend. I pushed my code twice but still have 92 warnings.
-
Carmen over 7 yearsafter git commit the warning disappeared
-
tontonCD over 7 yearsIt works for me, I did remove the DerivedData folder, and warnings were for files as "db.xcindexdb"
-
Admin over 7 yearsFor others: you have to located in the root folder of your Xcode project with executing the 'git add .' command: /MyXcodeProjects/AwesomeApp/
-
Stefan over 7 yearsThis worked for me, too. I had the issue after copying an existing project to make a derivative, but with cut down functionality ⇒ less source files.
-
samiq over 7 yearsthis did it for me, kind of annoying to see this in the IDE, they should either support source control well or none at all
-
EdwardM over 7 yearsFirst, I made sure to Commit and Push my latest changes. Then I did Xcode > Source Control > Discard All Changes, and it cleaned up all the errors for me.
-
EdwardM over 7 yearsAs you mentioned, I did make sure to Commit and Push my latest changes. But doing just that did not remove the errors. So then I did Xcode > Source Control > Discard ALL Changes, and it cleaned up all the errors for me.
-
eric about 7 yearscorrect answer... but the exact answer @emrekyv posted 3 months previous... He gets the vote up
-
George about 7 years@eric he suggested just to disable source control, I showed how to make it work correctly.
-
vib about 7 yearsif you want a finer control
git status
will show you the files to add and thengit add your_filename
-
MikeLondonUK about 7 yearsThis latest commit worked for me. I had a particular issue when deleting .xcdatamodel files in .xcproject. Subsequent warnings in .xcworkspace disappeared (if of interest, see my original issue which was resolved by following this commit changes advice here: stackoverflow.com/questions/43403412/…)
-
Adam Smaka about 7 yearsyou also have to restart xcode after commiting changes. only then errors will disappear.
-
emresancaktar about 7 yearswhen you commiting your files be sure to select all files to commit and problem should solve.
-
Shubham Naik almost 7 years@EdwardM make sure you added all those file paths that are giving you the missing warning
-
nyxee almost 7 yearsGoing to XCode -> Source Control -> Add xxx.xxx did the trick for me.
-
Viktor almost 7 yearsI have done two actions :1) "uncheck", 2) "check" for Enable Source Control. Warnings was disappeared.
-
Martin almost 6 yearsWhat if the project does not use version control or a version control system not supported by XCode.
-
Martin almost 6 yearsWhat if you don't use git?
-
Martin almost 6 yearsI got the problem and I don't use version control XCode is aware of. All version control done outside XCode.
-
Martin almost 6 yearsI don't use the version control inside XCode and sill got the problem.