0
votes

When I go to verify or compile any script, an error saying, "The system cannot find the file specified."

Error code when I verify a blank script

I am coding for a robot and began getting this error after installing the "LIDAR-Lite_v3" library. I have uninstalled and reinstalled Arduino and cleared the "C:\Users\Ryano\OneDrive\Documents\Arduino" folder so that the LiDAR library was not in the libraries folder.

There is still an issue after doing this. When I first create a new sketch it verifies. When I save it, then it throws this error. It says that it is having issues compiling to the mega, but if I change the board type it gives exactly the same error with that particular board. This leads me to believe that the board is not the issue.

Also, it is only the sketches in "C:\Users\Ryano\OneDrive\Documents\Arduino" that don't work. Example sketches work just find and finish compiling.

I've looked at other questions concerning this type of issue, but none of them are particular to my case.

1

1 Answers

0
votes

The error is caused by using the Arduino IDE with files located under the Windows OneDrive folder.

Arduino IDE 1.6.6 and newer use a tool named arduino-builder which is written in the Go programming language. Go does not correctly handle files in OneDrive, which resulted in this bug in arduino-builder.

Solutions:

A. Use a version of the Arduino IDE that has the bug fixed

That bug has now been fixed in the hourly build of the Arduino IDE so if you use that IDE version the problem will not occur:

http://www.arduino.cc/en/Main/Software#hourly

You should be aware that the hourly build is primarily intended for beta testing so you might encounter bugs that aren't present in the Arduino IDE production releases. However, since you're already encountering a bug in the production release, going from an IDE with a known show-stopper bug to one that might have some minor bugs seems like a good trade.

B. Don't use the Arduino IDE with files in OneDrive

You can work around the bug by not using the Arduino IDE with any files in OneDrive.

In this case it looks like you have your sketchbook located under OneDrive. You can change the location of the sketchbook folder via the Arduino IDE's File > Preferences > Sketchbook Location. Change that setting to any convenient folder on your computer as long as it's not in the OneDrive. The Arduino IDE does not automatically copy the contents of the previous sketchbook folder to the new location so you will need to do this manually.

If you're using the Windows App Store version of the Arduino IDE this solution will be a big more difficult since that IDE version stores some files in the OneDrive.

C. Other solutions

Other possible workarounds are described in the issue report thread:

https://github.com/arduino/arduino-builder/issues/254