Xcode 6 beta 3:无效的虚拟文件系统覆盖文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24622650/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:11:12  来源:igfitidea点击:

Xcode 6 beta 3: invalid virtual filesystem overlay file

xcodexcode6

提问by Daniel Schlaug

After updating to Xcode 6 beta 3 the compiler keeps crashing with the following error:

更新到 Xcode 6 beta 3 后,编译器不断崩溃并出现以下错误:

/[Long-path-goes-here]/all-product-headers.yaml:4:13: error: Could not find closing ]!
  'roots': [
            ^
fatal error: invalid virtual filesystem overlay file '/[Long-path-goes-here]/all-product-headers.yaml'
1 error generated.

回答by Daniel Schlaug

Solved by doing the following:

通过执行以下操作解决:

  1. Find the /[Long-path-goes-here]/all-product-headers.yaml (Go to Folder... in Finder)
  2. Replace the contents with the code below.
  3. Save and lock the file. (Get info for file, check locked.)
  1. 找到 /[Long-path-goes-here]/all-product-headers.yaml(在 Finder 中转到文件夹...)
  2. 用下面的代码替换内容。
  3. 保存并锁定文件。(获取文件信息,检查锁定。)

{ 'version': 0, 'case-sensitive': 'false', 'roots': [] }

{ 'version': 0, 'case-sensitive': 'false', 'roots': [] }

After this Xcode will complainabout not being able to write the file with this error this is expected and doesn't seem to affect the build. Edit:For most people. If it prevents you from running try disabling Defines Modulein Build Settingsof your Target:

在此之后Xcode 会抱怨无法写入带有此错误的文件,这是意料之中的,并且似乎不会影响构建。编辑:对于大多数人。如果它阻止你运行尝试禁用Defines ModuleBuild Settings您的目标的:

Unable to write to file /Users/user/Library/Developer/Xcode/DerivedData/.. (You don't have permission to save the file “all-product-headers.yaml” in the folder “Pods.build”.) 

Hat off to the discussion on Apple Developer forums. Also, this is the relevant issuein CocoaPods issue tracker.

对 Apple Developer 论坛上讨论脱帽致敬。此外,这CocoaPods 问题跟踪器中的相关问题

回答by jpsim

Try setting "Defines Module = YES" in your app target. Works for my project.

尝试在您的应用程序目标中设置“定义模块 = YES”。适用于我的项目。

回答by Daniel

Clean (command-shift-K), and clean-build-folder (command-alt-shift-K) and build again worked for me.

Clean(command-shift-K)和clean-build-folder(command-alt-shift-K)并再次构建对我有用。

回答by Juan Pablo

I had this problem because I deleted some old archives and files from my mac to make more space. However running pod install for this project solved it.

我遇到这个问题是因为我从我的 mac 中删除了一些旧的档案和文件以腾出更多空间。但是为这个项目运行 pod install 解决了它。

回答by samthui7

Perhaps your path to .yaml file contains 'character. It makes the parser confused. Using TextWrangler, you can see your path has different colors (red & black).

也许您的 .yaml 文件路径包含'字符。它使解析器感到困惑。使用 TextWrangler,您可以看到您的路径具有不同的颜色(红色和黑色)。

That's my case, and moving project to another path (which doesn't contain ') solved my problem.

这就是我的情况,将项目移动到另一条路径(不包含')解决了我的问题。

回答by Asi Givati

I solved it by delete the current project's DerivedDatafolder by (Xcode 8):

DerivedData通过(Xcode 8)删除当前项目的文件夹来解决它:

Xcode> Preferences> Locationstab > Click on the right arrow under DerivedData> inside the folder DerivedDatadelete the project folder. Better to do hard clean also by Shift+Cmd+Alt+K. And build.

Xcode> Preferences>Locations选项卡 > 单击DerivedData文件夹内 >下的右箭头 DerivedData删除项目文件夹。最好做硬清洁也由Shift+Cmd+Alt+K。并建造。

回答by josh-fuggle

Can fix with one shell command:

可以用一个 shell 命令修复:

echo "{\n\t'version': 0,\n\t'case-sensitive': 'false',\n\t'roots': []\n}" > /[Long-path-goes-here]/all-product-headers.yaml

Where the path is copied out of the Xcode error.

从Xcode错误中复制路径的地方。

See Daniel Schlaug's answer for background info

有关背景信息,请参阅 Daniel Schlaug 的回答

回答by arsenius

I get this error too frequently, so I've made a simple bash script based on Daniel Schlaug's answer. I've never needed to lock the file. Just copy the file referenced in your error log and use it as the only parameter. Don't forget to chmod +uxbefore running.

我经常收到这个错误,所以我根据 Daniel Schlaug 的回答制作了一个简单的 bash 脚本。我从来不需要锁定文件。只需复制错误日志中引用的文件并将其用作唯一参数。chmod +ux跑步前别忘了。

#!/bin/bash

if [ "$#" -eq "0" ]
then
   echo "No arguments supplied"
   exit
fi

rm -rf 
echo "
{
  'version': 0,
   'case-sensitive': 'false',
   'roots': []
 }" > 

回答by Dan1one

I tried all the answers above/below. None worked.

我尝试了上面/下面的所有答案。没有一个工作。

However, Restarting Xcode did it.

但是,重新启动 Xcode 做到了。

Try that before going into the madness of trying to fix the actual situation of the missing file. All the rest is madness. Heck, If that doesn't fix it. I would even try restarting every time you do one of the strategies listed here. Maybe one of those fix it but Xcode gets stuck until you restart it.

在尝试修复丢失文件的实际情况之前尝试一下。剩下的都是疯狂。哎呀,如果那不能解决它。每次您执行此处列出的策略之一时,我什至会尝试重新启动。也许其中之一可以修复它,但 Xcode 会卡住,直到您重新启动它。

Nothing else to do, Xcode is just too buggy at times.

没有别的事可做,Xcode 有时太有问题了。