Xcode: issue “file xxx.png is missing from working copy” at project building

后端 未结 24 1855
猫巷女王i
猫巷女王i 2020-12-04 08:22

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.\"

相关标签:
24条回答
  • 2020-12-04 08:36

    In my case I drag & dropped a number of files on my Xcode project window to add them. It made copies into my source directory but didn't put them where I wanted them to go (it put them at the root of my directory, I wanted them in a sub-directory). Without thinking I just grabbed them in the Finder and moved them to the directory I wanted them in. After going back into the project window it of course could not find them so I deleted them in the window and re added them. After compiling I started getting these errors.

    I thought, as some mention above that it was a git issue but when I ran "git ls-tree --full-tree -r HEAD" I didn't see the files at all??

    Anyway to fix it all I did was use the "Add File..." menu command to add each of the files to the default location, do a clean build, and then delete them from the project window (using move to trash) and it got rid of all the errors.

    0 讨论(0)
  • 2020-12-04 08:36

    This is definitely related to source control. I renamed and moved a couple of non-committed plist files and got this error. I am using svn. I was able to fix this via Source Control - Commit by removing old referenced files.

    0 讨论(0)
  • 2020-12-04 08:37

    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 .
    
    0 讨论(0)
  • 2020-12-04 08:38

    In XCode -> SoureControl:

    Update + Refresh Status did it for me.

    0 讨论(0)
  • 2020-12-04 08:38

    This works for me: Xcode -> ("option + click") Product -> Clean Build Folder...
    Than restart xCode

    0 讨论(0)
  • 2020-12-04 08:39

    I had the same issue and solved it by simply dragging the specified files from finder into the project navigator (ensuring that "copy files" is selected in the dialog) and committing the files.

    0 讨论(0)
提交回复
热议问题