简体   繁体   English

Xcode不允许将文件复制到捆绑

[英]Xcode not allowing to copy files to bundle

I am having problem in copying files to Xcode bundle. 将文件复制到Xcode捆绑包时出现问题。 I have some files in my bundle and i am trashing them and copy new same named one from another project. 我的文件包中有一些文件,我将其丢弃,然后从另一个项目中复制新的同名文件。 But regularly Xcode giving error as : Multiple errors occurred while copying the files. 但是通常Xcode给出错误为: 复制文件时发生多个错误。 I have done much RND but no solution. 我做了很多RND,但没有解决方案。 Can anybody help me out. 谁能帮我。 Thanx in advance. 提前感谢。

Because you just deleted files from your project but one copy of each file is still in folder where your project is. 因为您只是从项目中删除了文件,但是每个文件的一个副本仍位于项目所在的文件夹中。 Delete all red lines first if there is any. 如果有的话,请先删除所有红线。 And see below steps - 并查看以下步骤-

  1. Right Click on your project 右键点击您的项目
  2. Show in finder 在取景器中显示
  3. Find your files and delete them 查找您的文件并将其删除
  4. Now delete all red line files 现在删除所有红线文件
  5. Command+shift+k clean your project. Command + Shift + k清除项目。
  6. Now add new files. 现在添加新文件。

I realize this is an old post but am adding here in case others run into the same issue. 我意识到这是一篇过时的文章,但如果其他人遇到同样的问题,请在此处添加。 I was working on a project where I utilized AFNetworking and performed the following steps: 我正在使用AFNetworking的项目中执行以下步骤:

  1. I dragged and dropped the files into my project and asked xCode 5 to make a copy of the same (rather than create a reference). 我将文件拖放到我的项目中,并要求xCode 5复制相同的文件(而不是创建引用)。
  2. I needed to delete the folder/files I just imported and right clicked on the same in the file navigator in xCode and hit Delete - I did delete the folder/files in the manner laxonline describes above. 我需要删除刚刚导入的文件夹/文件,然后在xCo​​de的文件导航器中右键单击该文件夹/文件,然后单击Delete-我确实以上述laxonline的方式删除了该文件夹/文件。
  3. Attempted to re-add the AFNetworking library code back into my project and got the below message. 尝试将AFNetworking库代码重新添加回我的项目中,并得到以下消息。

在此处输入图片说明

The fix here is to follow the steps in the accepted answer - ie To right click on your project in xCode, select Show in Finder and then delete the offending files/folders. 解决方法是按照已接受的答案中的步骤操作-即,要在xCode中右键单击您的项目,请选择在Finder中显示,然后删除有问题的文件/文件夹。

I upvoted the accepted answer but am also posting this as a separate answer so I can highlight that the above can occur even if you select the correct delete option. 我提高了接受的答案的水平,但同时也将其作为单独的答案发布,因此,即使您选择了正确的删除选项,我也可以强调上述情况可能会发生。 In my case, I discovered that while the AFNetworking files were no longer in the directory, an empty folder with said name still existed. 以我为例,我发现虽然AFNetworking文件不再位于目录中,但仍然存在一个具有上述名称的空文件夹。

While deleting the exicting files from Xcode. 从Xcode删除令人兴奋的文件时。 The Xcode4 asks you "Do you want to permanently delete the file “fileName” from disk, or only remove the reference to it?" Xcode4询问您“您是要从磁盘上永久删除文件“ fileName”,还是仅删除对其的引用?”

By default the alert selects "Remove Reference Only" Change it to Delete. 默认情况下,警报选择“仅删除参考”,将其更改为“删除”。

在此处输入图片说明

while deleting files you must select move to trash option. 在删除文件时,您必须选择移至回收站选项。 If you select Remove References then only the link to those files gets removed and you will have to manually delete those files from their location. 如果选择“删除引用”,则只会删除指向这些文件的链接,而您将不得不从其位置手动删除这些文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode Copy Bundle Resources无法找到文件 - Xcode Copy Bundle Resources can't find files 如何使用Xcode4项目模板将文件添加到Copy Bundle Resources构建阶段 - How do I add files to the Copy Bundle Resources build phase with an Xcode4 Project Template iOS将文件从主包复制到文档目录 - iOS copy files from main bundle to documents directory 无法将文件从主包复制到 iPad 上的文档目录 - Can't copy files from main bundle to documents directory on iPad Copy Bundle Resources 构建阶段包含此目标的 Info.plist 文件 'Info.plist' in xcode 6? - The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist' in xcode 6? 如何将Xcode ui文件从一个项目复制到另一个项目? - How to copy xcode ui files from one project to another? Xcode-在iPhone模拟器上运行应用程序时复制文件 - Xcode - copy files when running an app on the iPhone simulator Xcode和Git源代码控制:“工作副本XXXXX无法提交文件” - Xcode and Git Source Control : “The working copy XXXXX failed to commit files” xcode / ios:尝试在安装时将文件复制到缓存文件夹 - xcode/ios: trying to copy files to caches folder on install 在Xcode中复制XIB文件-更改代码-保留旧链接 - Copy XIB files in Xcode - Change code - Old links remain
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM