Vscode-arduino: "Cannot find the sketch file" error when verifying/uploading code

Created on 17 Oct 2017  路  10Comments  路  Source: microsoft/vscode-arduino

I created an .ino file in VSCode using this Arduino extension. Everything seems to work fine, linked the extension to the folder where I have Arduino IDE 1.8.5 extracted. Intellisense is working fine. I can switch boards and open serial monitor.

The problem comes when I try to verify or upload the sketch to the board, then a popup message tells:

Cannot find the sketch file.

Here's a screenshot from the VSCode window when the error appears:
image

  • OS: Ubuntu 16.04 xenial, x86_64 Linux 4.10.0-37-generic
  • VSCode 1.17.1
  • Arduino IDE 1.8.5 for Linux
help wanted

Most helpful comment

For people still getting this issue: I needed to create a workspace for the .ino file I had. VSCode needs to create a hidden directory with the aforementioned file in it. Not doing so results in the above error. I created a vscode workspace along the .ino file I had and saved the workspace. Setup everything in VSCode in regards to arduino settings (port, board, etc) and everything worked as expected trying to upload to my nodeMCUs :)

Just trying to help people coming from google like I did.

All 10 comments

@EnforcerZhukov Wthat is the content in the arduino.json file?

Where is that file?

Where is the fukking arduino.json?! (MAC OS 10.12)

@starock , the arduino.json file is located in the exact project folder within .vscode. You can use ls -al to see it.

config the sketch value in arduino.json, for example : "sketch": "GetStarted.ino",

image

@EnforcerZhukov have you got this issue solved?

Hi again, thanks for the help.

Tried with a random sketch specifying the "sketch" in the arduino.json file and seems to work fine now!

image

@EnforcerZhukov great! May I close this issue if it has been resolved?

Please create a new issue if you still have this problem.

For people still getting this issue: I needed to create a workspace for the .ino file I had. VSCode needs to create a hidden directory with the aforementioned file in it. Not doing so results in the above error. I created a vscode workspace along the .ino file I had and saved the workspace. Setup everything in VSCode in regards to arduino settings (port, board, etc) and everything worked as expected trying to upload to my nodeMCUs :)

Just trying to help people coming from google like I did.

Was this page helpful?
0 / 5 - 0 ratings