Error Uploading program (can't open input file (directory))

today i trying to upload example program from Arduino to my board, but there's problem right there.. when i try to compile, it's okay but when try to upload there's message like this:

Arduino: 1.8.9 (Windows 7), Board: "Arduino/Genuino Uno"

avrdude: can't open input file C:\Users\Makarith\AppData\Local\Temp\arduino_build_951716/Sweep.ino.hex: No such file or directory
avrdude: read from file 'C:\Users\Makarith\AppData\Local\Temp\arduino_build_951716/Sweep.ino.hex' failed
An error occurred while uploading the sketch

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

im using Arduino Genuino Uno, port COM 5..
anyone can tell me whats problem? :disappointed_relieved:
Thank you..

This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

Hi Pert, Thank you so much for your reply !

im using smadav antivirus,i had try to disable my antivirus, but got nothing.. even uninstall it and restart my laptop, still not working :confused:

why my sweep.ino.ino.hex not created on C directory? i've looking for in forum about making .hex file, but there's message "this core does not support exporting sketches"

should i reinstall my windows?

thank you :slight_smile:

ranotes_:
im using smadav antivirus,i had try to disable my antivirus, but got nothing.

OK, it was only a guess that the antivirus could be the problem.

ranotes_:
even uninstall it

I only intended you to temporarily disable the antivirus for a single upload to determine if it was the cause of the problem. Please make sure to continue to use whatever precautions against viruses you feel are necessary.

ranotes_:
why my sweep.ino.ino.hex not created on C directory?

Unfortunately, I don't know.

Please do this:

  • (In the Arduino IDE) click File > Preferences
  • Check the box next to "Show verbose output during: > compilation
  • Click "OK"
  • Sketch > Verify/Compile
  • After the compilation fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the compilation output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the length of the output exceeds the forum's 9000 character limit, save it in a .txt file and post it here as an attachment. If you click the "Reply" button you'll see the "Attachments and other options" link.

ranotes_:
i've looking for in forum about making .hex file

The Arduino IDE should automatically create a .hex file and save it to the correct place. There is no need for you to do anything special to make one.

ranotes_:
but there's message "this core does not support exporting sketches"

This is very strange. Did you still have Tools > Board > Arduino/Genuino Uno selected when you got that message?

ranotes_:
should i reinstall my windows?

Wait on that. Hopefully the verbose compilation output will give some information we can use to help you.

pert:
Please do this:

here's the result from uploading with compilation check box, but when i do Verify/Compile everything's okay, i mean there's no Copy error Message. it only happens when uploading.. so here's result :

Arduino: 1.8.9 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Program Files\arduino-1.8.9\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\arduino-1.8.9\hardware -hardware C:\Users\Makarith\AppData\Local\Arduino15\packages -tools C:\Program Files\arduino-1.8.9\tools-builder -tools C:\Program Files\arduino-1.8.9\hardware\tools\avr -tools C:\Users\Makarith\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\arduino-1.8.9\libraries -libraries C:\Users\Makarith\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\Makarith\AppData\Local\Temp\arduino_build_911577 -warnings=none -build-cache C:\Users\Makarith\AppData\Local\Temp\arduino_cache_773865 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Program Files\arduino-1.8.9\libraries\Servo\examples\Sweep\Sweep.ino
C:\Program Files\arduino-1.8.9\arduino-builder -compile -logger=machine -hardware C:\Program Files\arduino-1.8.9\hardware -hardware C:\Users\Makarith\AppData\Local\Arduino15\packages -tools C:\Program Files\arduino-1.8.9\tools-builder -tools C:\Program Files\arduino-1.8.9\hardware\tools\avr -tools C:\Users\Makarith\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\arduino-1.8.9\libraries -libraries C:\Users\Makarith\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\Makarith\AppData\Local\Temp\arduino_build_911577 -warnings=none -build-cache C:\Users\Makarith\AppData\Local\Temp\arduino_cache_773865 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Program Files\arduino-1.8.9\libraries\Servo\examples\Sweep\Sweep.ino
avrdude: can't open input file C:\Users\Makarith\AppData\Local\Temp\arduino_build_911577/Sweep.ino.hex: No such file or directory
avrdude: read from file 'C:\Users\Makarith\AppData\Local\Temp\arduino_build_911577/Sweep.ino.hex' failed
An error occurred while uploading the sketch

one more if i check box Upload here's the result :
on error.txt file

pert:
This is very strange. Did you still have Tools > Board > Arduino/Genuino Uno selected when you got that message?

yeah, i still have my board on "Tools > Board > Arduino/Genuino Uno" . it happen when i Export Compiled Binary in Sketch>Export Compiled Binary. because i think Export Compiled Binary will create .hex file..

error.txt (6.58 KB)

ranotes_:
when i do Verify/Compile everything's okay, i mean there's no Copy error Message.

Sorry about that. I copy/pasted those instructions without thinking about the fact that there is no compilation error in your case. Although compilation is finishing successfully and the error is during the upload stage, the compilation process is when the .hex file should be created, so the problem is with the compilation stage.

Please do this:

  • (In the Arduino IDE) click File > Preferences
  • Check the box next to "Show verbose output during: > compilation
  • Click "OK"
  • Sketch > Verify/Compile
  • After the compilation finishes, click on the black console window at the bottom of the Arduino IDE window
  • Press "Ctrl + A". This will select all the text in the console window.
  • Press "Ctrl + C". This will copy all the selected text to the clipboard.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the compilation output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the length of the output exceeds the forum's 9000 character limit, save it in a .txt file and post it here as an attachment. If you click the "Reply" button you'll see the "Attachments and other options" link.

ranotes_:
i think Export Compiled Binary will create .hex file..

It will do that but it is intended to be used for when people want to use the .hex file for some usage outside the Arduino IDE. Export Compiled Binary doesn't save the .hex file in a place that can be used in the Arduino IDE's Upload process so it won't help with your problem.

pert:
Please do this:

here's the result from compiling..

C:\Program Files\arduino-1.8.9\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\arduino-1.8.9\hardware -hardware C:\Users\Makarith\AppData\Local\Arduino15\packages -tools C:\Program Files\arduino-1.8.9\tools-builder -tools C:\Program Files\arduino-1.8.9\hardware\tools\avr -tools C:\Users\Makarith\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\arduino-1.8.9\libraries -libraries C:\Users\Makarith\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\Makarith\AppData\Local\Temp\arduino_build_303696 -warnings=none -build-cache C:\Users\Makarith\AppData\Local\Temp\arduino_cache_861619 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Program Files\arduino-1.8.9\libraries\Servo\examples\Sweep\Sweep.ino
C:\Program Files\arduino-1.8.9\arduino-builder -compile -logger=machine -hardware C:\Program Files\arduino-1.8.9\hardware -hardware C:\Users\Makarith\AppData\Local\Arduino15\packages -tools C:\Program Files\arduino-1.8.9\tools-builder -tools C:\Program Files\arduino-1.8.9\hardware\tools\avr -tools C:\Users\Makarith\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\arduino-1.8.9\libraries -libraries C:\Users\Makarith\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\Makarith\AppData\Local\Temp\arduino_build_303696 -warnings=none -build-cache C:\Users\Makarith\AppData\Local\Temp\arduino_cache_861619 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Makarith\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Program Files\arduino-1.8.9\libraries\Servo\examples\Sweep\Sweep.ino

It will do that but it is intended to be used for when people want to use the .hex file for some usage outside the Arduino IDE. Export Compiled Binary doesn't save the .hex file in a place that can be used in the Arduino IDE's Upload process so it won't help with your problem.

so i don't have to make manual .hex? okayy thank youu :smiley:

This is extremely strange. There should be dozens more lines of output after those two as the sketch is compiled. If the last command shown there failed, then the IDE should detect that and fail the process, but it's not doing that, and it's not displaying an error message that might provide some helpful information.

Do you have 32 bit or 64 bit Windows?

yeah, it's strange i guess :confused: .. maybe because im using arduino IDE ZIP file from download?

pert:
Do you have 32 bit or 64 bit Windows?

my computer 64 bit btw..

I was suspicious that having the Arduino IDE installed under C:\Program Files could be a problem when using 64 bit Windows since I think Windows has some sort of special treatment of that folder for 64 bit applications and the Arduino IDE is a 32 bit application. However, I tested it out with the "Windows ZIP file for non admin install" version of Arduino IDE 1.8.9 installed in that folder and using Windows 7 but I still can't reproduce your problem.

You might try moving the arduino-1.8.9 folder somewhere else just to be sure that it's not its location in C:\Program Files that's causing a problem.

Purely me grasping at straws here but you could also try creating a folder named portable inside the Arduino IDE installation folder (currently C:\Program Files\arduino-1.8.9) and see if that makes the problem go away. The portable folder will cause the Arduino IDE to run in portable mode, which makes it not depend on files in any folders outside the Arduino IDE installation folder.

pert:
You might try moving the arduino-1.8.9 folder somewhere else just to be sure that it's not its location in C:\Program Files that's causing a problem.

i've try this way but got nothing :confused: .. i try to move folder "arduino 1.8.9" to my folder on local disk E and still can't upload

pert:
Purely me grasping at straws here but you could also try creating a folder named portable inside the Arduino IDE installation folder (currently C:\Program Files\arduino-1.8.9) and see if that makes the problem go away

also i've make folder named "portable" where's inside it there's file references and other..

when im using arduino create online everything's okay .. i think i have to delete this folder and install with windows installer.. :slightly_frowning_face: :frowning:

has anyone solve that problem ? I ' ve same error & can't find any clue

Please read the entire thread very carefully and try each possible solution that was presented.

After that, if you're still having the problem, provide a detailed list of the things you tried as well as the resuts.

well ,finally I found that was avrdude problem , it somehow reset by itself and we have manually write the file name like C : LED_TEST on Avrdude.
Instead trying to figure out how to fix that on my PC , I try installing Arduino IDE Ver1.0.5 and the problem gone.

tirtow:
well ,finally I found that was avrdude problem , it somehow reset by itself and we have manually write the file name like C : LED_TEST on Avrdude.
Instead trying to figure out how to fix that on my PC , I try installing Arduino IDE Ver1.0.5 and the problem gone.

There's a very good change we can help you get it working with the modern version of Arduino IDE, but only if you'll make an effort to provide all the necessary information. If you are using Arduino IDE 1.0.5 for anything but just uploading a basic sketch, you're going to find out it's too outdated to be useful. Many of the modern Arduino libraries and boards won't work with Arduino IDE 1.0.5.