Upload Issue: The system cannot find the file specified - Missing {path}

I recently upgrade to 1.8.1 from (1.6.x?). Since my upgrade I can't upload directly from the Arduino IDE. Here's the command that the IDE is trying to run :

{path}/bin/avrdude -C{path}/etc/avrdude.conf -v -patmega328p -carduino -PCOM8 -b57600 -D -Uflash:w:G:\BootIt\AppData\Local\Temp\arduino_build_575628/MyBlink.ino.hex:i

Here's the full first line of error:
java.io.IOException: Cannot run program "{path}/bin/avrdude": CreateProcess error=2, The system cannot find the file specified

If I open an cmd windows I can run this command this command like this:
C:\Program Files (x86)\Arduino\hardware\tools\avr>bin\avrdude.exe -C etc\avrdude
.conf -v -patmega328p -carduino -PCOM12 -b57600 -D -Uflash:w:G:\BootIt\AppData\L
ocal\Temp\arduino_build_432354/MyBlink.ino.hex:i

So I believe the issue is the {path} aren't defined. I tried looking for this in the platform.txt but no success. Where is this command defined?!

If you can help, I'll be grateful :slight_smile:

rounoff:
C:\Program Files (x86)\Arduino\hardware\tools\avr**>**bin\avrdude.exe -C etc\avrdude
.conf -v -patmega328p -carduino -PCOM12 -b57600 -D -Uflash:w:G:\BootIt\AppData\L
ocal\Temp\arduino_build_432354/MyBlink.ino.hex:i

Is that a copy paste error, or do you see the ">" character being used somewhere?

What do you have selected in the Tools > Board menu?

pert:
What do you have selected in the Tools > Board menu?

I have "Arduino Pro or Mini Pro" ... I did a test this morning with the nano and I had the same issue.

rounoff:
So I believe the issue is the {path} aren't defined. I tried looking for this in the platform.txt but no success. Where is this command defined?!

The Arduino AVR Boards package has the "Arduino Pro or Pro Mini" (I assume that's what you meant by "Arduino Pro or Mini Pro") and "Arduino Nano" boards. It defines {path} in platform.txt:

tools.avrdude.path={runtime.tools.avrdude.path}

{runtime.tools.avrdude.path} is automatically defined by the Arduino IDE using some sort of voodoo involving the Arduino15/package_index.json file if the avrdude tool is installed via Boards Manager or some other way if you're using the tool included with the Arduino IDE. I believe the problem is {runtime.tools.avrdude.path} is not defined, thus {cmd.path} gets defined as {path}/bin/avrdude and tools.avrdude.config.path gets defined as {path}/etc/avrdude.conf instead of {path} being expanded as usual. I believe this indicates something went wrong with your installation. There are a few options that might fix this (from least to most invasive):

  • See if there is an update to Arduino AVR Boards available in Tools > Board > Boards Manager and if so install it.
  • Run the Arduino IDE in portable mode by creating a folder named portable in the Arduino IDE installation folder and restarting the Arduino IDE.
  • Uninstall the Arduino IDE and delete the AppData\Local\Arduino15 and AppData\Remote\Arduino15 folders, then reinstall the Arduino IDE. Please be very cautious when deleting files on your computer. Backing things up is always a good idea.
  • Uninstall the Arduino IDE and delete the AppData\Local\Arduino15 and AppData\Remote\Arduino15 folders, then reinstall the Arduino IDE. Please be very cautious when deleting files on your computer. Backing things up is always a good idea.

This one did the trick. I had tried it but didn't delete everything but it seems it needed to reset all the preferences before reinstall!

In case other people try this. Make sure you don't delete your sketches by mistake (You should use git for them) :slight_smile:

Thanks a ton!
ROunofF

Glad to hear things are working again!

rounoff:
In case other people try this. Make sure you don’t delete your sketches by mistake (You should use git for them) :slight_smile:

Yes, the preferences.txt file is located in the Arduino15 folder so if you have a non-default sketchbook folder it could seem that you lost your sketches because you would need to reset the location in File > Preferences. I’ve gotten myself in a situation a couple times where I’m trying to help a beginner by telling them to delete things in the AppData folder when they are completely confused and don’t even understand the concept of folders and files. I decided that I should make a policy to err on the side of caution and not give that sort of advice on the forum anymore even though I very frequently see posts from people with this sort of issue and know exactly how I could help them solve the issue. I decided to take a chance with you since you seemed to know what you were doing. I would be nice if the Arduino developers could make the IDE more bombproof so this sort of thing is never necessary. It works fine for the majority of people but when something goes wrong the IDE does a very poor job of handling it.