Error -" process cannot access file because it is being used by another process"

Hello,

I am working on a project by Adafruit Overview | Bluefruit LE Feather Robot Rover | Adafruit Learning System.
The board I am working on is Adafruit Feather 32u4 Bluefruit (ATmega32u4, 8 MHz, 3.3V logic).

I use the code (Code | Bluefruit LE Feather Robot Rover | Adafruit Learning System)from Adafruit website and did not do any modification to it. When I compile, I got this errorC:UserspcAppDataLocalTemparduino_build_841169sketchRed.ino.cpp: The process cannot access the file because it is being used by another process.

I pasted part of the verbose message at the end of this post
I did not paste the full verbose message between code tags because the complete message exceeded the word limit of this post. I have attached a Word document with the full compile result, in case you need to look through it.

The Technical support of Adafruit had looked through the verbose messages while helping me on other errors. Those other errors were resolved with their help. This particular error (process cannot access file) however, they advised me to seek help with from Arduino Forum.

Before working on this project, I have tried out other sample sketches provided by Adafruit such as Blink, atcommand, and even the bleuart_cmdmode. All these sketches worked without issues. With the Blueart sketch I was able to send message to my phone and from my phone to the IDE.

Please guide me on this.

Also, please allow me to ask a question in advance: If this error is caused by Antivirus software (I am using McAfee Lifesave), why did the error occur only in this sketch but not other sample sketches?

Thank you for your time!

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Adafruit Feather 32u4"


open C:UserspcAppDataLocalTemparduino_build_841169sketchRed.ino.cpp: The process cannot access the file because it is being used by another process.
Error compiling for board Adafruit Feather 32u4.
[code]

[/code]

Mini Rover Error after installing Adafruit_MotorShield.doc (66 KB)

In my experience this problem is caused by anti virus software doing "on demand" scanning.

Hi UKHeliBob,

Thank you for your reply. I did try to compile the error at different times, the result is the same. If this is due to my antivirus running scan at the background all the time, do you have any recommendations on how to solve this problem? Is there a setting that I can change instead of disabling my antivirus? Turning off my antivirus each time I am compiling a sketch seems risky.

Would love to hear your input, thank you for your time!

snow_leopard: Hi UKHeliBob,

Thank you for your reply. I did try to compile the error at different times, the result is the same. If this is due to my antivirus running scan at the background all the time, do you have any recommendations on how to solve this problem? Is there a setting that I can change instead of disabling my antivirus? Turning off my antivirus each time I am compiling a sketch seems risky.

Would love to hear your input, thank you for your time!

I had the problem when compiling for an ESP8266 but for no other boards. I got round it for a while by temporarily turning off Mcafee on demand scanning but as the account that I normally use has no admin right I had to switch users to do it. Mcafee can exclude specific files from on demand scanning but the compilation process involves a different file each time so I could not use this to solve the problem.

In the end I uninstalled Mcafee and now use Windows Defender which causes no problems with compiling.