I'm a newbie, which might be part of the problem, but I've tried to do due diligence in debugging this myself.
I'm trying to use adafruit's library for their 16-channel PWM & Servo driver, but when I attempt to verify or upload their example programs pwmtest or servo I get the following error:
readlink C:\Users\paul\OneDrive\Documents\Arduino\libraries\Adafruit_PWMServoDriver\examples\pwmtest\pwmtest.ino: The system cannot find the file specified.
Error compiling for board Arduino/Genuino Uno.
I've verified that the address in the error is actually correct; the file is there. I can copy that address, paste it into windows file explorer, click on that file, attempt to verify, and I get the error that the file isn't there. Every other example file uploads just fine
I'm running the 1.8.5 Arduino IDE straight off the windows store on a windows 10 machine, and I'm using an uno.
To get the library I downloaded Adafruit-PWM-Servo-Driver-Library-master.zip and renamed the file therein to Adafruit_PWMServoDriver and put that directory into C:\Users\paul\OneDrive\Documents\Arduino\libraries.
Compiles fine for me. I get one warning because I have compiler warnings set to ALL. Try installing the library through Sketch->Include Library->Manage Libraries... It's called "Adafruit PWM Servo Driver Library" and currently Version 1.0.0.
/Users/john/Documents/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library/examples/pwmtest/pwmtest.pde: In function 'void setup()':
/Users/john/Documents/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library/examples/pwmtest/pwmtest.pde:39:11: warning: unused variable 'twbrbackup' [-Wunused-variable]
uint8_t twbrbackup = TWBR;
^
Sketch uses 3550 bytes (11%) of program storage space. Maximum is 32256 bytes.
Global variables use 419 bytes (20%) of dynamic memory, leaving 1629 bytes for local variables. Maximum is 2048 bytes.
I am getting the error as well. I am not even trying to use a library, if I try to compile just a blink sketch it gives the readlink error. readlink D:\OneDrive\Documents\ArduinoData\packages: The system cannot find the file specified. It gives the error even though there is a packages folder at that directory.
The IDE worked fine for at least a year with the sketch folder in OneDrive until the Windows 10 Creator update. Now the IDE throws the "cannot find file" error after I reopen a sketch. For example, I can type in and run a sketch. Save it to the sketch folder on onedrive. Close the IDE. Reopen the IDE. Load the previously working sketch. The readlink error appears immediately on compile.
I notice that Example sketches always run when loaded from onedrive but fail when saved back to onedrive in a new folder so there may be something related to the read protection of the Examples folders.
The IDE has this problem with the sketches whether they are in the cloud or available locally.
Running IDE 1.8.5 on Windows 10 Insider preview Build 17025
I've tried to do a bit more digging on this - it happens on all my pc's which have been updated to the latest stable release of windows - in my case Windows 10 Enterprise version 1709 build 16299.19 running IDE 1.8.5.
The bit that is actually erroring is arduino-builder.exe, which is getting a SHARING VIOLATION error when trying to create a file in \hardware
High Resolution Date & Time: 09/11/2017 17:17:12.6825392
Event Class: File System
Operation: CreateFile
Result: SHARING VIOLATION
Path: D:\Onedrive\Personal\OneDrive\Development\Arduino\hardware
TID: 22580
Duration: 0.0000697
Desired Access: Generic Read
Disposition: Open
Options: Synchronous IO Non-Alert, Open Reparse Point
Attributes: n/a
ShareMode: None
AllocationSize: n/a
Hi,
I just want to report that I'm seeing the same error while verifying/uploading a sketch. My configurations is also Win10 Fall Creators update, and it fails if the sketch is on a OneDrive folder.
I just moved it to non Onedrive folder and now is ok.
The strange thing is that I have 2 computers, one laptop (SUrface Pro 4) and a desktop (Dell Optiplex), I maintain my user files synchronized on both machines using OneDrive, and I also try to keep them with the exact same configuration on everything else (Apps, folders, any customization, etc.)
The problem is only present on the SP4, not on the desktop.
For the time being when I'm working on the SP4, I'll have to put my sketches on a non OneDrive folder, and later move....
PaulS:
Isn't that obvious? Don't work out of the OneDrive folder.
That's a very unhelpful answer. I for one always work in a onedrive folder. So I have continuous backup and file versioning. I have moved folders including "Documents" into the Onedrive folder. The Arduino IDE is the only thing I have found so far that doesn't work. And, sadly, provides a very unhelpful error message.
Uncheck "Save space and download files as you use them" under "Files on Demand" in the "Settings" tab in the OneDrive settings.
Same here, the workaround works for me. I just ran into this after a Win 10 auto-update changed my default for "Files on Demand" from off to on! I noticed file manager was providing status updates for my OneDrive files, but did not realize the setting had been changed or even what "Files on Demand" feature was for that matter.
Yes a permanent fix is the preferred option. OneDrive is a fact of life so Arduino will need to gain compatibility at some point.
I had the same problem. Windows 10, reinstalled the IDE to most recent version. Other replies have more details about why the problem was happening with the Arduino folder in Onedrive, but if you want a quick solve like me and still want your docs folder for example to use OneDrive, move your Arduino folder elsewhere (ex. Desktop) and change your folder location in the IDE under preferences to the location you placed it.
Fixed it up for me and I also happened to finish my project with 1 line of code afterwards