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

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

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


当前回答

显示在目标->构建阶段->拷贝Bundle资源。 和 清除构建文件夹命令+shift+alt+k

其他回答

在XCode 8之后的每个项目中都有这个。这就解决了问题:

与选项键按下,产品(在标题菜单)->清洁构建文件夹。

这个问题似乎有不同的原因,但它通常与源代码控制软件有关。

在我的例子中,我通过转到Git并再次添加文件来解决这个问题。我的意思是运行以下命令:

git add .

显示在目标->构建阶段->拷贝Bundle资源。 和 清除构建文件夹命令+shift+alt+k

这些警告不是构建警告,而是关于SVN存储库的警告。

显示的目录不再存在是正确的,CocoaPods现在将头存储在Pods/ headers /{Private,Public}中。您必须更新工作副本以反映这些更改。

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