I can't seem to even manage to upload any code to the Arduino- Error message cop

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

c:\program files (x86)\arduino\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

exit status 1
Error compiling for board Arduino/Genuino Uno.
Invalid library found in C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\project: C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\project
Invalid library found in C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\sketch_apr20a: C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\sketch_apr20a
Invalid library found in C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\project: C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\project
Invalid library found in C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\sketch_apr20a: C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\sketch_apr20a

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

(deleted)

Turn off files on demand or do not locate sketchbook in onedrive.

There are a few things going on here.

The first is the use of the Arduino IDE with files in your OneDrive. There is a bug in the IDE that may cause problems when used with OneDrive. You can find details here:

Next you have these invalid library warnings. That won't cause any actual problems but can be annoying to see all the time. You should only ever put libraries in the libraries subfolder of your sketchbook folder (currently C:\Users\lynnm\OneDrive\Documents\Arduino\libraries). It looks like you have saved a sketch there at C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\sketch_apr20a and I don't know what C:\Users\lynnm\OneDrive\Documents\Arduino\libraries\project is but it's not a valid library. Move those folders somewhere else to fix the warning.

Finally we have the real problem:

c:\program files (x86)\arduino\hardware\tools\avr\bin\../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

I suspect this actually has nothing to do with OneDrive and certainly it has nothing to do with the invalid libraries. This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

Thanks for your advice! i think i have sorted the onedrive problem by saving it on my PC but now have this error message!

avrdude: ser_open(): can't set com-state for "\.\COM3"

Do you know what this is for?