Error with arduino sketch upload !

Hello,
I am trying to upload a sketch to an arduino Nano. At first i thought there is a problem with my sketch, but then I made a test by uploading the blink sketch in examples. The sketch is not being uploaded it is taking so much time and giving the error below. But when I upload my sketch to the arduino Uno, it uploads successfully. I tried to uninstall the IDE and then install but the error kept happening. Please help it is really frustrating ! I had a similar thing before but the problem was solved with uninstall and reinstall of the IDE, but not this time !

here is the error:

Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano, ATmega328P"

C:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\ACER\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10812 -build-path C:\Users\ACER\AppData\Local\Temp\arduino_build_992646 -warnings=none -build-cache C:\Users\ACER\AppData\Local\Temp\arduino_cache_670481 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Arduino\hardware\tools\avr -verbose C:\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Arduino\arduino-builder -compile -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\ACER\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10812 -build-path C:\Users\ACER\AppData\Local\Temp\arduino_build_992646 -warnings=none -build-cache C:\Users\ACER\AppData\Local\Temp\arduino_cache_670481 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Arduino\hardware\tools\avr -verbose C:\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'nano' from platform in folder: C:\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\sketch\\Blink.ino.cpp" -o nul
Generating function prototypes...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\sketch\\Blink.ino.cpp" -o "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\sketch\\Blink.ino.cpp" -o "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\sketch\\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\ACER\AppData\Local\Temp\arduino_cache_670481\core\core_arduino_avr_nano_cpu_atmega328_2caceeb2327f081f1da40ecf6d10a0ef.a
Linking everything together...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.elf" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646\\sketch\\Blink.ino.cpp.o" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/..\\arduino_cache_670481\\core\\core_arduino_avr_nano_cpu_atmega328_2caceeb2327f081f1da40ecf6d10a0ef.a" "-LC:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646" -lm
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.elf" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.eep"
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.elf" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.hex"
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_992646/Blink.ino.elf"
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
C:\Arduino\hardware\tools\avr/bin/avrdude -CC:\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\ACER\AppData\Local\Temp\arduino_build_992646/Blink.ino.hex:i 
An error occurred while uploading the sketch

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch

Select Tools > Processor > ATmega328P (Old Bootloader) and then try uploading again.

pert:
Select Tools > Processor > ATmega328P (Old Bootloader) and then try uploading again.

Pert thanks a lot It worked ! but i would like to know why this happen because i was using the new bootloader for many times and everything was working find but then suddenly not ! why ?!

In the beginning of 2018 Arduino started shipping Nanos with a new bootloader. You needed to update the IDE (or better, the board manager) to be able to make use of it (or select e.g. Uno instead of Nano if I'm not mistaken).

The new board manager gives you the options 328P (for new boot loader) or 328P old boot loader.

Before that new board manager, you had the option 328P which was for the old boot loader.

sterretje:
In the beginning of 2018 Arduino started shipping Nanos with a new bootloader. You needed to update the IDE (or better, the board manager) to be able to make use of it (or select e.g. Uno instead of Nano if I'm not mistaken).

The new board manager gives you the options 328P (for new boot loader) or 328P old boot loader.

Before that new board manager, you had the option 328P which was for the old boot loader.

yes i know i had these 2 options all the time, but selection was the new bootloader not the old and everything was working fine, but suddenly nothing is working until you told me to choose the old bootloader

Is it the same Nano that you're using?
Did you burn the bootloader (and hence you have to select the other one now)?