ios Xcode:在项目构建时发出“工作副本中缺少文件 xxx.png”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25338428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode: issue "file xxx.png is missing from working copy" at project building
提问by Iban
After deleting/adding some png files to project, i have got messages when building project.
删除/添加一些 png 文件到项目后,我在构建项目时收到消息。
"file ProjectPath\aaa\xxx.png is missing from working copy."
“工作副本中缺少文件 ProjectPath\aaa\xxx.png。”
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?
所有这些文件都在项目中,并且应用程序正在运行。但是,这些消息很烦人。看了 .plist 文件,但没有提到这些文件。我应该怎么做才能删除这些消息?
回答by Alexander Vasenin
The warning will disappear as soon as you commit your changes (Xcode 8).
一旦您提交更改(Xcode 8),警告就会消失。
回答by nbloqs
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 并再次添加文件来解决它。我的意思是运行以下命令:
git add .
回答by emrekyv
You can also disable source control by unchecking
您还可以通过取消选中来禁用源代码控制
Xcode -> Preferences -> Source Control -> Enable Source Control
Xcode -> Preferences -> Source Control -> Enable Source Control
if you're managing it via command line or any other app.
如果您通过命令行或任何其他应用程序管理它。
回答by coyer
In XCode -> SoureControl:
在 XCode -> SoureControl 中:
Update
+ Refresh Status
did it for me.
Update
+Refresh Status
为我做的。
回答by Ronen
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
- Xcode-> 源代码管理-> 提交
- 右键单击丢失的文件
- 选择放弃更改
回答by George
Disable Source Control, clean build folder (Alt+Shift+Cmd+K
), then Enable Source Control again.
禁用源代码管理,清理构建文件夹 ( Alt+Shift+Cmd+K
),然后再次启用源代码管理。
Xcode -> Preferences -> Source Control -> Enable Source Control
Xcode -> Preferences -> Source Control -> Enable Source Control
回答by kubi
In my case, Xcode had somehow found old .svn
directories that referenced the missing files. I had to go upa level above my project folder to find those .svn files. Once deleted, I restarted Xcode and everything was fine.
就我而言,Xcode 以某种方式找到.svn
了引用丢失文件的旧目录。我必须在我的项目文件夹上方上一层才能找到那些 .svn 文件。删除后,我重新启动了 Xcode,一切都很好。
回答by Gabrielle Earnshaw
I had a similar issue with a handful of files that had long since been deleted from my Xcode project while I was still using Xcode 7.
当我仍在使用 Xcode 7 时,我遇到了一些早已从我的 Xcode 项目中删除的文件的类似问题。
My solution was to:
我的解决方案是:
- Create files with the names Xcode was complaining about (they don't need any content)
- Add the files to my Xcode project (in Xcode right click on my main project directory, click Add files to my_project_nameand select the files that were just created
- Select the newly added files and delete them - select move to trash.
- 使用 Xcode 抱怨的名称创建文件(它们不需要任何内容)
- 将文件添加到我的 Xcode 项目中(在 Xcode 中右键单击我的主项目目录,单击将文件添加到 my_project_name并选择刚刚创建的文件
- 选择新添加的文件并删除它们 - 选择移至垃圾箱。
This got rid of the warnings for me.
这消除了对我的警告。
回答by EdwardM
To add onto Alexander Vasenin's answer...
添加到 Alexander Vasenin 的回答中......
First I Committed and Pushed my changes
首先,我承诺并推动了我的更改
Xcode Main Menu > Source Control > Commit
Xcode 主菜单 > 源代码管理 >提交
Then I Discarded All Changes to get rid of the errors
然后我放弃了所有更改以消除错误
Xcode Main Menu > Source Control > Discard All Changes
Xcode 主菜单 > 源代码管理 >放弃所有更改
After that, the errors stating "file xxx.png is missing from working copy" disappeared.
之后,说明“工作副本中缺少文件 xxx.png”的错误消失了。
回答by Kang Byul
This is occurred when you delete file on Xcode, but didnt tell svn server about it.
当您在 Xcode 上删除文件但没有告诉 svn 服务器时会发生这种情况。
Go to command line tool, and delete file directly.
进入命令行工具,直接删除文件。
svn delete missingFile.m
and commit it
并提交
svn commit -m "Deleting file"
note that if you delete .svn folder, the warning is disappear but you will lost communication with svn server.
请注意,如果您删除 .svn 文件夹,警告会消失,但您将失去与 svn 服务器的通信。