I used to get this error.
I don't remember which step actually corrected but.
- Make sure your project is closed.
- Make sure windows explorer does not have the directory that you are writting to in it's windows.
- File size my be a problem.
Hope one of these helps...