ios Xcode-7:没有那个文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31024956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode- 7: No such file or directory
提问by Dani M. Smith
I keep trying to run my Xcode project (titled "YidKit") and it keeps giving me the following error:
error: /Users/Dani/Library/Developer/Xcode/DerivedData/YidKit-exnbjyxkgkbeaedoznkmtoenfijq/Build/Products/Debug-iphoneos/YidKitTests.xctest: No such file or directory
. I spent several hours online, trying different solutions that I've seen, and nothing has worked. This is driving me crazy, because it is the only error left and I just finished getting rid of about 80 that were caused by Swift 2.0. I appreciate all of the help I can get!
我一直想经营我的Xcode项目(标题为“YidKit”),它不断给我下面的错误:
error: /Users/Dani/Library/Developer/Xcode/DerivedData/YidKit-exnbjyxkgkbeaedoznkmtoenfijq/Build/Products/Debug-iphoneos/YidKitTests.xctest: No such file or directory
。我在网上花了几个小时,尝试了我见过的不同解决方案,但没有任何效果。这让我发疯,因为这是唯一剩下的错误,我刚刚摆脱了由 Swift 2.0 引起的大约 80 个错误。我很感激我能得到的所有帮助!
UPDATEHere is an image of the file in the explorer. The red one is the file that is giving me the error.
更新这是资源管理器中文件的图像。红色的是给我错误的文件。
回答by Pravin Tate
do following two things I might solve your problem.
做以下两件事我可能会解决你的问题。
- Product -> Clean and build folder
- Go to finder -> library -> Developer -> Xcode -> Derived data delete that folder
- 产品 -> 清理并构建文件夹
- 去 finder -> library -> Developer -> Xcode -> Derived data 删除那个文件夹
or check screen shot may be this is your problem
或检查屏幕截图可能是您的问题
and then check
然后检查
回答by stellar lee
TARGETS --> Build Phases --> search file --> delete redundant .m
目标 --> 构建阶段 --> 搜索文件 --> 删除多余的 .m
回答by Ricardo Alves
For future reference
备查
One way you can solve this problem is to open your Project with a text editor and search for the file there. It should be there the file path for it. Just delete it and any references that might exist of the file.
解决此问题的一种方法是使用文本编辑器打开您的项目并在那里搜索文件。它应该在那里有它的文件路径。只需删除它和文件中可能存在的任何引用。
It should be working now.
它现在应该可以工作了。
Don't forget to BACKUP FIRST before doing this
在执行此操作之前不要忘记先备份
回答by Ted
Go to project, target, build phase
进入项目、目标、构建阶段
- remove the files causing problem (click - below)
- add the files again (File -> Add Files to Project)
- clean then run
- 删除导致问题的文件(点击下方)
- 再次添加文件(文件 -> 将文件添加到项目)
- 清理然后运行
回答by user6240643
You should try to edit option in folder to show more you looking then you will see some error file inside after you find it delete it! Hope this help.
您应该尝试编辑文件夹中的选项以显示更多您正在查看的内容,然后您会在找到它后看到一些错误文件将其删除!希望这有帮助。
回答by Grambo
I'm sure you've figured out a workaround by now but for those still running into this problem the error is occurring because Xcode is trying to access a file for your project, but it can no longer find it. In your case the file it can't find is YidKitTests.xctest
, so what you can do is click on it in the Project Navigator, then on the right in the File Inspector, click on the little folder icon under Location. When you click on the folder a Finder window will open up and its your job to navigate to where the YidKitTests.xctest
file should be and double click on it. More often than not the file is in the exact place Xcode says it isn't, eg. /Users/Dani/Library/Developer/Xcode/DerivedData/YidKit-exnbjyxkgkbeaedoznkmtoenfijq/Build/Products/Debug-iphoneos/YidKitTests.xctest
, but for some reason it can't see it without you pointing it out. I hope this helps!
我相信您现在已经找到了一个解决方法,但是对于那些仍然遇到这个问题的人来说,错误正在发生,因为 Xcode 正在尝试访问您项目的文件,但它无法再找到它。在您的情况下,它找不到的文件是YidKitTests.xctest
,所以您可以做的是在项目导航器中单击它,然后在文件检查器的右侧,单击位置下的小文件夹图标。当您单击文件夹时,Finder 窗口将打开,您的工作是导航到YidKitTests.xctest
文件所在的位置并双击它。通常情况下,文件位于 Xcode 所说的确切位置,例如。/Users/Dani/Library/Developer/Xcode/DerivedData/YidKit-exnbjyxkgkbeaedoznkmtoenfijq/Build/Products/Debug-iphoneos/YidKitTests.xctest
,但由于某种原因,如果您不指出,它就无法看到它。我希望这有帮助!
回答by Kevin Gray
I had a similar error popping up, and it turned out being the simulator was not being found. So, I deleted all my simulators and and added new ones. This fixed it for me. It's pretty unlikely this will be a fix for you, but I really wish I had seen this response 3 hours ago.
我弹出了类似的错误,结果是找不到模拟器。因此,我删除了所有模拟器并添加了新模拟器。这为我修好了。这对您来说不太可能是一个解决方案,但我真的希望我在 3 小时前看到这个回复。
回答by Amr
The solution which worked with me is as following:
与我合作的解决方案如下:
Go in the left panel of the Xcode to products folder then select the Tests.xctest file
In the right panel of Xcode / Target Membership, unselect Tests
Click command u
在 Xcode 的左侧面板中转到 products 文件夹,然后选择 Tests.xctest 文件
在 Xcode / Target Membership 的右侧面板中,取消选择 Tests
单击命令 u
回答by MiracleDebris
Just delete the "Derived Data" folderand compile the project again.
只需删除“Derived Data”文件夹并再次编译项目。
回答by theswed
Anyone tried the good old trick rebooting the computer? I tried and everything worked out fine! Give it a try
有没有人尝试过重新启动计算机的好老技巧?我试过了,一切都很好!试一试