Try the blink example with an LED (and resistor) connected to A4 and replace LED_BUILTIN with A4. Disconnect every thing else from A4 to test the pin by itself. What happens?
Use a meter and check the continuity between the connector pin for A4 and Pin-27 (PC4) of the ATmega328P. I found this discontinuity problem with another connector pin of my UNO, and I corrected it by putting a jumper.
Take out the MCU (if it is 28 Pin DIP) from the socket; carefully straighten Pin-27 (the PC4 pin) and put the MCU back in the socket. Activate a code to assert Logic High at this pin. Use DVM and measure the voltage level of Pin-27. If it is close to 5V, there is a leakage/loading of the PCB track on the Arduino Board. In this case, the Pin-27 can still be used; there is a spare connector pin near the IOREF pin of UNO; a jumper wire can be installed from Pin-27 to the spare pin. Good luck!