在删除/添加一些png文件到项目后,我在构建项目时收到了消息。

"文件ProjectPath\aaa\xxx.png在工作副本中丢失。"

所有这些文件都在项目中,应用程序正在运行。然而,这些信息很烦人。查看。plist文件,但没有提到这些文件。 我应该怎么做才能删除这些信息?


当前回答

就我而言,模拟器中的旧项目数据是错误的。通过在模拟器中重置内容和设置解决:

模拟器->重置内容和设置…

其他回答

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),这样就消除了所有错误。

对我来说,以下方法是有效的:

因为我没有也从来没有使用过Git,所以我创建了一个新项目(XCode 8,我看不到通常的“使用Git”或任何标记)。然后我直接删除了这个新项目中的所有文件;转到那个乱七八糟的旧项目,复制项目文件夹中的所有内容,回到新创建的项目,粘贴旧的东西,打开它——所有关于几个月前不存在的文件的警告都消失了。祈祷。

这是发生在你在Xcode上删除文件,但没有告诉svn服务器。

进入命令行工具,直接删除文件。

svn delete missingFile.m 

然后提交

svn commit -m "Deleting file"

注意:如果删除“。SVN”文件夹,该警告会消失,但会导致与SVN服务器失去通信。

在我的例子中,Xcode以某种方式找到了引用丢失文件的旧.svn目录。我必须在我的项目文件夹上一个级别才能找到那些.svn文件。删除后,我重新启动Xcode,一切正常。

一旦你提交了修改,警告就会消失(Xcode 8)。