When a phone isn’t charging despite being plugged in, check whether a software crash or an operating system update is causing the problem by performing a hard reset or rolling back the update. Test the USB cable on another similar device to determine whether it’s functional, or use a different USB cable on the same phone to check whether the charging port is the culprit. As a last resort, replace the battery.
To resolve the charging issue related to the operating system crashing, perform a hard reset on your iPhone by holding the Power and Home buttons at the same time for 30 seconds. For Android phones, boot the device into the recovery mode by holding Volume Up, Volume Down and Power keys, select the Recovery Mode option, and then select Factory Reset. If this key combination doesn’t work, consult the documentation that came with your phone. Make sure to back up personal data before performing a hard reset.
If the charging port is at fault, use an antistatic brush or a new toothbrush to gently clean debris from the port. In cases where a liquid caused damage to the port, the only solution is to completely replace it. If the charging cable is at fault, replace it with a cable that’s certified by the phone’s manufacturer. If the charging software detects power fluctuations from the power source, use a different source, and avoid charging the phone via USB hubs that can’t provide adequate power.