Error while uploading code avrdude: stk500_getsync()

Are you sure the chip you're using is bootloaded (and with the correct bootloader?)

Uno expects a chip clocked at 16mhz and optiboot bootloader at 115200 baud.

If you've got something else on the chip, it will not upload.