avrdude: stk500v2_ReceiveMessage(): timeout

This is making me crazy, anyone has a solution for it? I have been researched for few hours haven't found anything useful online, this seems like a very old issue.

Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 642 bytes (0%) of program storage space. Maximum is 253,952 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 8,183 bytes for local variables. Maximum is 8,192 bytes. avrdude: ser_open(): can't open device "\.\COM3": Access is denied.

avrdude: ser_drain(): read error: The handle is invalid.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_recv(): read error: The I/O operation has been aborted because of either a thread exit or an application request.

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

Does the Arduino Mega show up in Windows' Device Manager?

Yes it does.

I have a similar problem. After attempting to use an Atmel-ICE debugger ( as far as I can tell it doesn't work on the Arduino Mega2560) I get

avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer