Can't compile Arduino sketches on Windows 10

d:\arduino\hardware\tools\avr\bin../lib/gcc/avr/5.4.0/../../../../avr/bin/ar.exe: unable to rename 'C:\Users\Keanny\AppData\Local\Temp\arduino_build_987803\core\core.a'; reason: Permission denied

exit status 1
Error compiling for board Arduino/Genuino Uno.

This is what I have been getting every few days since I've installed the Arduino IDE on my Huawei Matebook D laptop running Windows 10.

I use a genuine Arduino Uno. When I first got this error message, I did a lot of things to, hopefully, fix this, like changing to a different USB port (There are 2, one on the left and another on the right.), reconnecting the Uno, closing and reopening the IDE and more. Currently, the only solution I've found to work is to reinstall the IDE, of which I'm tired of doing right now. Right now, every time I want to use Arduino for programming, I have to reconfigure the boards and the ports and hope to get a miracle.

A little later, I saw that there are, in fact, some problems that other people had faced while using the Arduino IDE in Windows 10. I tried using the IDE on Windows 7 devices and it seems 100% ok. What is going on and what should I do to fix it?


(P/S: Is it possible to print out foreign lanuguages like Chinese using the Serial Port?)

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.

(P/S: Is it possible to print out foreign lanuguages like Chinese using the Serial Port?)

There is a bug that causes problems if you haven't saved the sketch:

This is also somewhat related:

pert, I've tried that and it worked! Thank you a lot!

btw I used to have AVG Antivirus on the computer (my dad installed it, not me) and now I'm using the built-in Windows Antivirus software.

You're welcome. I'm glad to hear it's working now. Enjoy!