Swift 3 / Xcode 8升级 - 工作副本错误中缺少100个DerivedData文件 [英] Swift 3 / Xcode 8 Upgrade - 100's of DerivedData files missing from working copy errors

查看:77
本文介绍了Swift 3 / Xcode 8升级 - 工作副本错误中缺少100个DerivedData文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到XCode和Swift的最新Beta版本但是在使用转换器后我的app项目现在有超过200个构建时间黄色错误全部说明/projectDirectoy/ DerivedData / XXXXXXXXX / XXXX / XXX / xXXX / xXX工作副本中缺少... XXXXX表示DerivedData文件夹中的各种文件路径。

I have just upgraded to the latest Beta version of XCode and Swift but after using the converter my app project now has over 200 build time yellow errors all stating /"projectDirectoy"/DerivedData/XXXXXXXXX/XXXX/XXX/xXXX/xXX is missing from working copy... where by the XXXXX's represent various file paths in the DerivedData folder.

我尝试从错误中提到的位置删除DerivedData文件夹。

I have tried deleting the DerivedData folder from the location mentioned in the errors.

我已经尝试删除〜/ Library /中的DerivedData文件夹中的所有内容。

I have tried deleting everything in the DerivedData folder in ~/Library/.

我试过多次清理项目,重新启动并重新构建。

I have tried multiple times to clean the project, reboot and do a fresh build.

我尝试关闭偏好中的源代码控制但我不明白为什么我应该关闭它在我更新之前就已经开启,所以我希望它继续使用。

I have tried turning off source control in preferences but I don't see why I should turn this off as it was on before I updated so I want it left on.

这些错误似乎不会消失。

These errors just won't seem to go away.

任何想法?

推荐答案

在更新到xCode 8 GM,超过350后,我面临同样的警告。其中大部分都是其中.swift文件和资产目录中的图像。

I was facing the same warnings after updating to xCode 8 GM, over 350. Most of them where .swift files and images in the asset catalog.

它基本上是一个源控制问题,似乎主要出现在移动/删除项目文件时。这些都是新的警告,或者xCode 8对源代码控制的要求比xCode 7要严格得多。

It is basically a Source Control issue that seems to mainly appear when you move/delete project files. These are either new warnings or xCode 8 is just a lot more strict with source control than xCode 7.

谷歌搜索后我找到了一些答案,但它们似乎很复杂我例如使用命令行甚至建议关闭和重新打开源控制。

After googling about this I found some answers, but they seemed complicated to me e.g using command line or even suggesting turning source control off and back on.

这适用于我的所有项目。

Here is what worked for all my projects.

短路

首先尝试这个,如果它不起作用漫长的方式

Try this first and if it does not work than do the long way

1)转到源代码管理菜单(窗口和帮助旁边的顶部菜单),然后单击刷新状态

1) Go to Source Control menu (top menu next to window and help) and click Refresh Status

2)再次转到源代码管理菜单并单击提交

2) Go to Source Control menu again and click commit

3)提交窗口应该打开xCode认为必要的所有提交。因此,只需在文本字段框中输入提交,然后按提交按钮。

3) The commit window should open with all the commits xCode thinks are necessary. So just enter a commit in the text field box and press the commit button.

重复步骤1-3,直到打开提交时xCode不再选择任何项目菜单。在xCode自动选择的所有项目都已提交之前,请不要进入步骤4,否则在执行步骤4时可能会出错。

Repeat step 1-3 until there are no more items selected by xCode when you open the commit menu. Do not go to step 4 until all the items automatically selected by xCode have been committed otherwise you might get an error when doing step 4.

4)再次打开提交窗口,如步骤3中所述,xCode不应再选择任何项目。但是,您仍然应该看到左侧边栏中的一些项目是导致警告消息的项目。

4) Open the commit window again and as mentioned in step 3 there should be no more items selected by xCode. However you should still see some items in the left sidebar which are the ones causing the warning messages.

右键单击某个项目,然后按全选,在文本字段中输入提交,然后按提交按钮。一切都应该完成,警告/错误应该消失(可选择再次按CommitMenu->刷新状态)。

Right click on a item and press select all, enter a commit in the text field and than press the commit button. Everything should complete and the warning/errors should go away (optionally press CommitMenu->Refresh Status again).

如果它没有完成而不是关闭/重新打开xCode而不是重做步骤1-4。

If it does not complete than close/reopen xCode and than redo step 1-4.

如果这种情况不起作用,那么应该修复它。

If that also does not work than the long way should fix it.

Long Way

如果您使用源代码管理并定期提交,则可选择执行步骤1,而您应该可以直接执行步骤11。

If you use source control and make commits regularly than optionally do step 1 and than you should be able to go straight to step 11.

1)清理xCode来源数据(可选)

1) Clean xCode derrived data (Optionally)

您通常不必这样做,所以跳过第一次尝试时执行此步骤并转到步骤3.

You usually dont have to do this so skip this step on your 1st attempt and go to step 3.

转到xCode首选项,单击位置选项卡,然后转到高级。单击高级按钮旁边的小箭头以打开派生文件夹的路径。完全关闭xCode,然后删除该派生文件夹中的所有内容。

Go to xCode preferences, click on the "locations" tab, and then go to advanced. Click on the little arrow next to the advance button to open the path to the derived folder. Close xCode completely and than delete all content that is in that derived folder.

成员Krivvenz在他的回答中如此友好地指出,你可能必须选择这样做。我没有必要自己这样做,所以也许跳过这个,只有尝试它才能工作。

As member Krivvenz has so kindly pointed out in his answer you might have to optionally do this. I did not have to do this myself so maybe skip this and only try it if it doesnt work.

我还必须从相对于Custom更改DerivedData选项可以在Xcode>首选项>位置选项卡中找到。

"I also had to change my DerivedData option from relative to Custom which can be found in Xcode > Preferences > Locations Tab."

2)重新启动xCode项目并等待索引完成。这可能需要几分钟,因为您刚刚删除了派生数据。

2) Relaunch your xCode project and wait for the indexing to finish. This might take a few minutes because you just deleted the derived data.

3)转到源代码管理菜单(窗口和帮助旁边的顶部菜单),然后单击刷新状态

3) Go to Source Control menu (top menu next to window and help) and click Refresh Status

4)再次转到源代码管理菜单并单击提交

4) Go to Source Control menu again and click commit

5)提交窗口应该打开xCode认为必要的所有提交。因为我以前从未使用过源代码控制,所以我已超过250个。

5) The commit window should open with all the commits xCode thinks are necessary. I had over 250 as I never used source control before.

6)点击右下角的提交更改

6) Click on commit changes at the bottom right

7)我收到错误并且操作没有完成(如果它适用于你而不是11)

7) I got an error and the operation did not finish (if it works for you than go to 11)

8)转到源代码管理菜单并单击刷新状态

8) Go to Source Control menu and click Refresh Status

9)转到源代码管理然后单击提交

9) Go to Source Control and click commit

10)单击右下角的提交更改。这次它建议少了30次提交,我没有错误。如果您在第二次尝试时仍然出现错误,请尝试完全关闭Xcode,然后重新打开它,然后重复此步骤。

10) Click on commit changes at the bottom right. This time it suggested about 30 commits less and I got no errors. If you still get errors on your 2nd attempt try closing Xcode completely and than reopening it and than repeat this step.

11)转到来源控制菜单,然后单击刷新状态

11) Go to Source Control menu and click Refresh Status

12)转到源控制菜单并单击提交

12) Go to Source control menu and click commit

13)这次xCode不应该推荐更改,但是你仍然会在左侧的提交菜单中看到很多文件(未标记)。这些文件正在抛出工作副本警告,它们也应该存在。

13) This time there should be no changes recommended by xCode but you will still see a lot of files in the commit menu on the left (unticked). Its these files that are throwing the working copy warnings, which should also still be there.

14)选择其中的每一个文件提交菜单的左侧边栏。
您可以右键单击并按下全部检查

14) Select every one of those files in the left sidebar of the commit menu. You can right click and press check all

15)点击右下角的提交更改

15) Click on commit changes at the bottom right

16)我收到错误,但操作没有完成。所以我又尝试了同样的错误,所以我关闭了提交菜单。如果它完成了你也没关系。

16) I got an error and the operation did not complete. So I tried again and same error, so I closed the commit menu. If it completes for you thats fine too.

17)转到源代码管理菜单并单击刷新状态

17) Go to Source Control menu and click Refresh Status

所有警告都消失了。

18)完全关闭你的项目和xCode

18) Close your project and xCode completely

19)再次打开您的项目

20)转到源代码管理菜单然后单击刷新状态

20) Go to Source Control menu and click Refresh Status

21)转到源代码管理菜单并单击提交

21) Go to Source Control menu and click commit

22)我突然又提出了150多次提交。确保选中所有建议,然后点击提交,它应该没有错误地完成。

22) I suddenly had 150+ commits suggested again. Make sure all suggestions are selected and than click on commit and it should complete without errors.

23)清理你的项目(产品 - >清洁)

23) Clean your project (Product->Clean)

24)转到源代码管理菜单并单击提交。应该不需要进行任何更改,左侧边栏中也应该没有文件。

24) Go to Source Control menu and click commit. There should be no changes required and there should also be no files in the left sidebar.

毕竟我没有更多警告,不需要删除源代码管理一切都像往常一样再次运作。

After all this I have no more warnings, didn't need to delete source control and everything is working again as usual.

如果你将来遇到更多错误,比如因为你再次移动了一个文件,而不仅仅是再次提交,确保一切都是选择。

If you get more errors in the future, say because you moved a file again, than just make commits again, making sure everything is selected.

希望这会有所帮助。

这篇关于Swift 3 / Xcode 8升级 - 工作副本错误中缺少100个DerivedData文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆