Hi, I recently found that once I save my code I am no longer able to download or verify the code, and instead get the error message "Error Compiling for Arduino/Genuino Uno". But once I copy the same code into a new tab, I am able to download or verify the code. This is occurring for multiple different codes. In the error bar, it states that it is unable to find the file in the correct location, except when I manually look it is there. I also ran a command prompt search which showed the file is being saved in the correct location. I first tried restarting my computer, which didn't work. I also updated my computer, and then downloaded the newest version of arduino, both of which were unsuccessful. What else can I do to fix this problem?
I am running Windows 10.
Thank you!
When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
readlink C:\Users\chana\OneDrive\Documents\Arduino\LDRs_for_arm\LDRs_for_arm.ino: The system cannot find the file specified.
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The problem is caused by using the Arduino IDE with files located under the OneDrive folder.
The easiest solution is to not use 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 do want to continue using the Arduino IDE with OneDrive, you may be interested to know that the bug has already been fixed in the beta build of the Arduino IDE, which you can download here:
but be aware that version of the Arduino IDE is primarily intended only for beta testing so you may have a higher chance of encountering bugs than you would using the production releases of the IDE.
To see details on the problem, steps that are being taken to fix it, and other possible workarounds that will allow you use the Arduino IDE with OneDrive, see: