xcode 无效的虚拟文件系统覆盖文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32381933/
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
Invalid virtual filesystem overlay file
提问by brimstone
I put another project inside my main project, this one called OAuthSwift and it contained a framework. When I tried to build it, I got this error:
我在我的主项目中放了另一个项目,这个项目叫做 OAuthSwift,它包含一个框架。当我尝试构建它时,出现此错误:
<unknown>:0: error: invalid virtual filesystem overlay file '/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Intermediates/OAuthSwift.build/Debug/OAuthSwiftOSX.build/unextended-module-overlay.yaml'
<unknown>:0: error: clang importer creation failed
<unknown>:0: 错误:无效的虚拟文件系统覆盖文件 '/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Intermediates/OAuthSwift.build/Debug/OAuthSwiftOSX.build/unextended-module -overlay.yaml'
<unknown>:0: 错误:clang 导入器创建失败
After some research, I tried everything all the people said - I opened the file called all-product-headers.yaml
and I expected it to contain this (what the websitesaid):
经过一番研究,我尝试了所有人所说的一切 - 我打开了名为的文件all-product-headers.yaml
,我希望它包含以下内容(网站上所说的):
{
'version': 0,
'case-sensitive': 'false',
'roots': [
but instead it contained this:
但它包含以下内容:
{
'version': 0,
'case-sensitive': 'false',
'roots': [
{
'type': 'directory',
'name': "/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Products/Debug/OAuthSwiftOSX.framework/Headers",
'contents': [
{
'type': 'file',
'name': "OAuthSwiftOSX-Swift.h",
'external-contents': "/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Products/Debug/OAuthSwiftOSX.framework/Versions/A/Headers/OAuthSwiftOSX-Swift.h"
},
{
'type': 'file',
'name': "OAuthSwiftOSX.h",
'external-contents': "/Users/gabrieljones/Desktop/Coding/Xcode/Paul's Console/OAuthSwift-master-11/OAuthSwiftOSX/OAuthSwiftOSX.h"
}
]
},
{
'type': 'directory',
'name': "/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Products/Debug/OAuthSwiftOSX.framework/Modules",
'contents': [
{
'type': 'file',
'name': "module.modulemap",
'external-contents': "/Users/gabrieljones/Library/Developer/Xcode/DerivedData/Paul's_Console-bbbxnfmomaaurfeabxmnchoqmwpa/Build/Intermediates/OAuthSwift.build/Debug/OAuthSwiftOSX.build/module.modulemap"
}
]
}
]
}
Yes, I changed it to the version I was supposed to like this:
是的,我把它改成了我应该喜欢的版本:
{
'version': 0,
'case-sensitive': 'false',
'roots': []
}
And then I locked it, but I got the unable to write to file error as WELL as the invalid virtual filesystem overlay file error. Can anyone help?
然后我锁定了它,但是我遇到了无法写入文件的错误,就像无效的虚拟文件系统覆盖文件错误一样。任何人都可以帮忙吗?
回答by Stunner
Encountered this issue randomly while re-running my app after making changes on Xcode 8.0. I tried Product > Clean
, and even deleted the build folder cmd + option + shift + k
and deleted the derived data folder entirely, but that didn't end up working. Still got the same error. Restarting Xcode is what ended up working for me.
在 Xcode 8.0 上进行更改后重新运行我的应用程序时随机遇到此问题。我试过Product > Clean
,甚至删除了构建文件夹cmd + option + shift + k
并完全删除了派生数据文件夹,但这最终没有奏效。仍然得到同样的错误。重新启动 Xcode 最终对我有用。
回答by nanospeck
Hey I got a feeling about this: I think this might just be a case where Xcode is broken when you have non-alphanumeric characters in your target name. My project also had and apostrophe in the target name
嘿,我对此有一种感觉:我认为这可能只是当您的目标名称中包含非字母数字字符时 Xcode 损坏的情况。我的项目在目标名称中也有撇号
Yours: /Xcode/DerivedData/Paul's_Console
你的:/Xcode/DerivedData/ Paul's_Console
Mine: /Xcode/DerivedData/Lord's_Prayer
我的:/Xcode/DerivedData/ Lord's_Prayer
Can you try changing your target name. I got an hint about thought from here.
您可以尝试更改目标名称。我从这里得到了一个关于思想的暗示。
回答by josephap
It seems that if any item in the path contains certain non-alphanumeric characters, then you will encounter this issue.
似乎如果路径中的任何项目包含某些非字母数字字符,那么您就会遇到此问题。
I encountered this problem, because the name of my Xcode scheme contained an apostrophe. My target's name was totally free of non-alphanumeric characters. Removing the apostrophe allowed me to build.
我遇到了这个问题,因为我的 Xcode 方案的名称包含一个撇号。我的目标名称完全没有非字母数字字符。删除撇号允许我构建。
Thank you nanospeck for giving me the clue that lead to this discovery.
感谢 nanospeck 为我提供导致这一发现的线索。
回答by Prabhjot Singh
Faced the same problem while archiving my project but you can get rid of this issue by deleting the DerivedData of the app.
在归档我的项目时遇到了同样的问题,但您可以通过删除应用程序的 DerivedData 来解决这个问题。
Following are steps to delete DerivedData:
以下是删除 DerivedData 的步骤:
1) Select the Organizer from window menu of the xcode.
1) 从 xcode 的窗口菜单中选择 Organizer。
2) Now you need to select the builds one by one.
2)现在您需要一一选择构建。
3) You can delete the selected build by pressing delete button from the keyboard.
3) 您可以通过按键盘上的删除按钮来删除选定的构建。
This will clear up all the derivedData for the project and now you are ready to go ahead. Have fun guys :)
这将清除项目的所有衍生数据,现在您已准备好继续。祝大家玩得开心:)
回答by Zaid Pathan
Not only deleting DerivedData
works,
you need to delete ModuleCache
folder as well and it worked for me.
不仅删除DerivedData
作品,您还需要删除ModuleCache
文件夹,这对我有用。
回答by Jakub Truhlá?
After Cleanand Clean build folder...let the Xcode finish the Indexing, then build.
在Clean和Clean 构建文件夹之后...让 Xcode 完成Indexing,然后构建。
回答by Edwin R
So after running into this issue myself I found that the cause is the use of ' in my project name. So I renamed my project following the steps outlined by Luke and Dan.
因此,在自己遇到这个问题后,我发现原因是在我的项目名称中使用了 '。所以我按照 Luke 和 Dan 概述的步骤重命名了我的项目。
But after cleaning and building I got a linker error. The problem was solved by:
但是在清理和构建之后,我遇到了链接器错误。问题是通过以下方式解决的:
- going clicking on the project in the "Project navigator" on the left then going selecting "Build Phases"
- In the "Link Binary with Libraries" remove the library with the old name
- then clean and build (Command + Shift + K to clean, Command + B to build).
- 单击左侧“项目导航器”中的项目,然后选择“构建阶段”
- 在“Link Binary with Libraries”中删除旧名称的库
- 然后清理并构建(Command + Shift + K 进行清理,Command + B 进行构建)。
回答by Pikacz
It in my case error was caused by enum nested in class
在我的情况下,错误是由嵌套在类中的枚举引起的
changing
改变
class A {
private enum E {
...
}
...
}
into
进入
fileprivate enum E {
...
}
class A {
...
}
solved problem
解决了问题