Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid virtual filesystem overlay file

Tags:

xcode

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:

<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

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 website said):

{
    '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?

like image 748
brimstone Avatar asked Sep 03 '15 17:09

brimstone


5 Answers

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.

like image 94
Stunner Avatar answered Nov 05 '22 05:11

Stunner


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

Yours: /Xcode/DerivedData/Paul's_Console

Mine: /Xcode/DerivedData/Lord's_Prayer

Can you try changing your target name. I got an hint about thought from here.

like image 24
nanospeck Avatar answered Nov 05 '22 06:11

nanospeck


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.

Thank you nanospeck for giving me the clue that lead to this discovery.

like image 4
josephap Avatar answered Nov 05 '22 06:11

josephap


Faced the same problem while archiving my project but you can get rid of this issue by deleting the DerivedData of the app.

Following are steps to delete DerivedData:

1) Select the Organizer from window menu of the xcode.

2) Now you need to select the builds one by one.

3) You can delete the selected build by pressing delete button from the keyboard.

This will clear up all the derivedData for the project and now you are ready to go ahead. Have fun guys :)

like image 3
Prabhjot Singh Avatar answered Nov 05 '22 07:11

Prabhjot Singh


Not only deleting DerivedData works, you need to delete ModuleCache folder as well and it worked for me.

like image 3
Mohammad Zaid Pathan Avatar answered Nov 05 '22 05:11

Mohammad Zaid Pathan