If you close all Arduino IDE windows, start the Arduino IDE again, and then upload to your board, does the error message still appear?
If you close all Arduino IDE windows, start the Arduino IDE again, and then upload to your board, does the error message still appear?