AVRDUDE Error (Arduino Leonardo)
I had lots of issues when I first started.  these are all things I tried and at least one of them stopped this problem occurring, but I haven't a clue which.


Close the IDE (if you are using it and open it again)
Disconnect your board, wait 10 seconds and reconnect it.
Check you settings, are you using the correct board, etc.
Use a different cable.
Update your drivers.
Update your IDE/Toolset.
Use a different physical port on your PC.
Load the Blink example, if that doesn't work you serious have issues.
Reboot your PC.
If you can, try a different PC.