在删除/添加一些png文件到项目后,我在构建项目时收到了消息。
"文件ProjectPath\aaa\xxx.png在工作副本中丢失。"
所有这些文件都在项目中,应用程序正在运行。然而,这些信息很烦人。查看。plist文件,但没有提到这些文件。 我应该怎么做才能删除这些信息?
在删除/添加一些png文件到项目后,我在构建项目时收到了消息。
"文件ProjectPath\aaa\xxx.png在工作副本中丢失。"
所有这些文件都在项目中,应用程序正在运行。然而,这些信息很烦人。查看。plist文件,但没有提到这些文件。 我应该怎么做才能删除这些信息?
当前回答
我有同样的问题,并通过简单地将指定的文件从finder拖到项目导航器(确保“复制文件”在对话框中被选中)并提交文件来解决它。
其他回答
就我而言,模拟器中的旧项目数据是错误的。通过在模拟器中重置内容和设置解决:
模拟器->重置内容和设置…
当我还在使用Xcode 7时,我的Xcode项目中有几个文件早就被删除了,我也遇到了类似的问题。
我的解决方案是:
用Xcode抱怨的名字创建文件(他们不需要任何内容) 将文件添加到我的Xcode项目(在Xcode中右键单击我的主项目目录,单击Add files to my_project_name,并选择刚刚创建的文件 选择新添加的文件并删除它们-选择移动到垃圾。
这让我摆脱了警告。
在我的案例中,这是git和不区分大小写的文件系统的问题。
我无意中提交了两次相同的文件,使用的文件路径只在以防万一时不同:
MyProject/Resources/foo.png
MyProject/resources/foo.png
Xcode抱怨丢失了一个文件。
修正删除违规文件,并重新添加。
cd MyProject
mv Resources/foo.png /tmp
git rm Resources/foo.png
git rm resources/foo.png
git commit
mv /tmp/foo.png Resources
git add Resources/foo.png
git commit
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.
我认为,正如上面提到的,这是一个git问题,但当我运行“git ls-tree -full-tree -r HEAD”时,我根本看不到文件??
无论如何,为了解决这个问题,我所做的就是使用“Add File…”菜单命令将每个文件添加到默认位置,进行干净的构建,然后从项目窗口中删除它们(使用move to trash),这样就消除了所有错误。
显示在目标->构建阶段->拷贝Bundle资源。 和 清除构建文件夹命令+shift+alt+k