Xcode 6 beta 3: invalid virtual filesystem overlay file - xcode

After updating to Xcode 6 beta 3 the compiler keeps crashing with the following error:
/[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.

Solved by doing the following:
Find the /[Long-path-goes-here]/all-product-headers.yaml (Go to Folder... in Finder)
Replace the contents with the code below.
Save and lock the file. (Get info for file, check locked.)
{
'version': 0,
'case-sensitive': 'false',
'roots': []
}
After this Xcode will complain about 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 Module in Build Settings of your Target:
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 issue in CocoaPods issue tracker.

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

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

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.

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).
That's my case, and moving project to another path (which doesn't contain ') solved my problem.

I solved it by delete the current project's DerivedData folder by (Xcode 8):
Xcode > Preferences > Locations tab > Click on the right arrow under
DerivedData > inside the folder DerivedData delete the project folder.
Better to do hard clean also by Shift+Cmd+Alt+K.
And build.

Can fix with one shell command:
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.
See Daniel Schlaug's answer for background info

I tried all the answers above/below. None worked.
However, Restarting Xcode did it.
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.
Nothing else to do, Xcode is just too buggy at times.

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 +ux before running.
#!/bin/bash
if [ "$#" -eq "0" ]
then
echo "No arguments supplied"
exit
fi
rm -rf $1
echo "
{
'version': 0,
'case-sensitive': 'false',
'roots': []
}" > $1

Related

Error: No such file (sftp liximomo extension)

I have this problem when I upload a file on the server using the extension liximomo/vscode-sftp for visual studio code.
[error] Error: No such file
at SFTPStream._transform
at SFTPStream.Transform._read
at SFTPStream._read
How I can fix this problem? I tried to upload files to different servers, so I guess it's not a server-related problem but an extension.
There is a better fix on GitHub that works for upload and download via SFTP extension:
Do a search inside ~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.js for options.emitClose = false;
Add options.autoDestroy = false; after both instances.
- mrjcgoodwin commented 8 days ago
This is apparently a brand new problem that has been introduced into the newer versions of VS Code. I have FOUND A SOLUTION that seems to work well, by modifying a single line in the extension code. This is only valid for version 1.12.9 of the liximomo.sftp extension.
Here are the steps:
Shutdown / Quit VS Code.
Locate the following file:Mac OS X:
~/.vscode/extensions/liximomo.sftp-1.12.9/node_modules/ssh2-streams/lib/sftp.jsWindows:C:\Users\account_name\.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2-streams\lib\sftp.js
Make a backup copy of the file.
Modify line 388, which should be:if ( code === STATUS_CODE . OK ) { changing it to:if (code === STATUS_CODE.OK || code === STATUS_CODE.NO_SUCH_FILE) {
Save the file.
Relaunch VS Code; test by uploading or downloading from your sftp server. The error should not be present.
The alternative solution involves downgrading your version of VS Code. This is not desirable as you are not getting the latest fixes, security patches, etc..
See the following links regarding this issue:
https://github.com/liximomo/vscode-sftp/issues/266
https://github.com/liximomo/vscode-sftp/issues/569 (repeat)
https://gitmemory.com/issue/liximomo/vscode-sftp/915/827578565 (note, this site has a bad SSL certificate).
If you want to downgrade your VS Code; use this link to find the older versions:
https://code.visualstudio.com/updates/v1_55
CREDIT:
Bao from: https://blog.naver.com/PostView.nhn?blogId=pcgun70&logNo=222341271496
From their blog entry (translated by Google to English):
"At first, there was no solution, but Now, 12 hours later, the Holy
One appeared, who told me how to solve it.files that sftp cannot find
in the first place. There is a calling phrase, VScode is upgraded and
an error is called. It came out. Actually, I did not solve the
problem. Even if the file is not found, the same result as the
success process is exported. It is just a modification. It is
expected that a modified version will be released in the future."
Not an answer to the problem, but solution in another (simple) way:
install Run On Save VSCode extension
write a deploy.sh script along the lines
rsync -avz -e 'ssh -i /home/user/.ssh/id_rsa' --exclude '.history' --exclude '.vscode' --exclude '.git' --exclude '.gitignore' --exclude 'deploy.sh' ./ user#domain.net:/home/user/public_html/
add the following configuration to VSCode settings.json to trigger the deploy.sh script on file save:
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".*",
"isAsync": false,
"cmd": "${workspaceFolder}/deploy.sh"
},
]
}
Just switch to the second one:
There is another solution only upgrading the ssh2 package from the extension.
You just need to go to the extension path:
Windows:
C:\Users\your-user\.vscode\extensions\liximomo.sftp-1.12.9
When you are there, change the version of ssh2 package on the package.json file to ^1.1.0. Finally, just run npm install.
You should restart VSCode.
Alternatively, you could use a fork of the repository that is active and fixing these issues: https://github.com/Natizyskunk/vscode-sftp

Can't build a VS project on macOS

I get "Sharing violation on path" error whenever I try to build a VS project on macOS if the project is not in Users/../projects folder. I keep my work files on separate drive (exFat) which is perfectly accessable and works fine both under windows and macOS.
I assume it happens because of some permissions' violation but I am very new to macOS and can't figure it out.
macOS version - Mojave
Fixed in the way like kinhoon said, thanks.
One useful side note: we can use "Home" env variable instead of hardcoded users/<user_id> folder
<IntermediateOutputPath Condition=" '$(OS)' == 'Unix' ">$(Home)\path_to_folder\$(Platform)\$(Configuration)</IntermediateOutputPath>
Looks like it's a bug related to the way OS or VS handles writing on file systems FAT and exFAT.
https://www.feval.ca/posts/fixing-cs2012/#fn:1
I found another solution, which you can still keep your code in exFAT.
https://xamarin.github.io/bugzilla-archives/15/15093/bug.html
The solution in the above link suggests to manually edit the project file and put the following line into the build configuration to put the intermediate files in your Mac volume:
<IntermediateOutputPath Condition=" '$(OS)' == 'Unix' ">\Users\your_user_id\path_to_folder\$(Platform)\$(Configuration)</IntermediateOutputPath>
Note that you need to replace your_user_id and path_to_folder in the line above with your own values specific to your Mac installation.
The best is to put the line in every platform and configuration.
You can actually put it somewhere other then Users folder, but that seems to be the best place to put.

VS Code "Can not resolve workspace folder"

I've just started noticing something strange in VSCode 1.24.1 on MacOS 10.12.6 Sierra.
My file explorer has been marking my current working directories as "unresolved". This does not prevent me from doing anything I normally would though I am wondering why this is happening. The folder name will be yellow and will be marked with an ! on the right.
I've tried closing and reopening the directories in my file explorer, restarting VSCode itself and moving the folder to a separate directory. Nothing doing.
I haven't been able to find much on the issue except in the case of people working in Typescript files that aren't properly configured in a manifest file on React projects. These are mostly HTML/CSS/Sass/JS/MySQL.
Any insight would be appreciated, thank you.
I was having the same issue on Windows when I had previously created different projects on the undefined workspace (the default workdspace of VSCode).
When I create a workspace and I placed my root folders inside this one workspace, it will warn that it could not resolve workspace folder.
You have to edit your workspace config file, change the path of your folders and then restart VSCode.
On the VSCode command palette, type: workspace config - then choose "Open workspace configuration file."
You should have something like this:
{
"folders": [
{
"path": "OneProject"
},
{
"path": "AnotherProject"
}
],
"settings": {}
}
What you want is something like this:
{
"folders": [
{
"path": "C:/Somewhere/OneProject"
},
{
"path": "C:/Somewhere/AnotherProject"
}
],
"settings": {}
}
It's a known issue, it was fixed here - https://github.com/Microsoft/vscode/issues/50866
As of the 1.24.1 version it's not yet available. But the fix listed above should correct the problem you are having.
Replace ${workspaceFolder} with ${FOLDER_NAME:workspaceFolder} in your *.code-workspace file. (from here)
By the way, same goes to ${workspaceRoot}, you can replace it with ${FOLDER_NAME:workspaceRoot}.
Any more folder variables ca be fixed with this FOLDER_NAME: prefix? My workspaces did not use them so far.
Worked for me in Version: 1.44.2.
I had this issue also with VS and also showing an exclamation mark as well as the error code you have said, my solution was to go into my work folder where my file was located and in that folder i right clicked and re-arranged the folder so it was showing them as application order and it got rid of the error code and exclamation mark.
In my case I resolved this by restarting the WSL machine by writing the following in the windows cmd
wsl --shutdown
take care this might stop running docker containers and other related processes.
Then I started a new wsl terminal and vscode worked like a charm.
I deleted the folder and created a new one with a different name and it was fixed. No workspace config file fix needed as it fixes/updates itself when you change folder structure and update projects.
Please, remember to check what you opened. I struggled for this very stupid error for a day.
If you open VSCode, and then Open Folder, and then Add Folder, do not execpt theat ${workspaceFolder} will be you last folder, or the folder of your code. Its valeue will be the first folder you added...

Not able to upload application because of .sh file of Crittercism

We are using Crittercism SDK since last 2 years and we are successfully able to upload application. Since last 2 days, we are not able to upload application with Crittercism because of dsym_upload.sh file.
Anyone getting same issue...!!!
This issue is resolved in CrittercismSDK 5.2.0 CocoaPods spec: https://github.com/CocoaPods/Specs/blob/master/Specs/CrittercismSDK/5.2.0/CrittercismSDK.podspec.json
If you don't want to upgrade to 5.2.0, then just delete the file
and remove these lines from the Pods-resources.sh file
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
That shell script should not be part of the app bundle as it's only used while building (if it's anything like the Crashlytics version then it just uploads the .dsym files to their server so crash logs can be symbolicated for you).
Find the Build Phase Copy Files step that is copying it to the app bundle and remove the script from that step.
EDIT Please note that the script still needs to be executed during a build in order to upload debug symbols, however it does not need to be copied to the app bundle.
Had the same issue using cocoa pods.
As a temporary workaround I have put the following into my Podfile:
post_install do |installer|
...
system('perl -pi.back -e "s/install_resource \"CrittercismSDK\/CrittercismSDK\/dsym_upload.sh\"//" "Pods/Target Support Files/Pods/Pods-resources.sh"')
end
What it does is it removes the line where the dsym_upload.sh is copied as a resource to what in the end ends up in you .app file
I've also met this kind of problem. In my case, it was caused by putting space and special character in the package file name (.app file). After changing the name (removed space and special character) I was able to sign and upload application without any problems.

converter-sample.c contains duplicate main

I'm trying to deploy an application on the mac app store.
I'm working through the process of adding the code to validate the recipts
In accordance to the documentation I've compleated the follwing steps
Installed asn1c using sudo port install asn1c
Created a file modlule.asn1 in a directory asn1c_dir from listing 1-1.
cd asn1c_dir
asn1c -fnative-types module.asn1
Then in Xcode "add existing files" and add the asn1c_dir directory
Try building, but I get ~900 errors
In the target build settings, I check the box next to "Always Search User Paths"
I now get a single error saying "Duplicate symbol _main in /foo/bar/ppc/converter-sample.o and /foo/bar/ppc/main.o
I've tracked this to the fact that it looks like the file converter-sample.c declares it's own int main() function which is bad right?
any help would be appreciated.
So for metric reasons, I'll answer this question.
converter-sample.c is an unnecessary file. Delete it. Go about your life a happy person.

Resources