Why does my google account not work? I rooted my LG G3 awhile back and everything was fine. One day, I couldn't access my gmail or play store using the installed apps due to a connection error. I factory reset my phone and whenever I try to add my gmail account, I get an error that says "Can't establish a reliable connection to the server". How do I go about fixing this?

Note: I'm with Verizon on 4.4.2
check date/time

If they are "too far off", it might cause problems with certificates – which then either appear "not yet valid" (with your date too far in the past), or "no longer valid" (with your date too far in the future). Most Google components such as Playstore, Gmail, Sync, use secure communications, and thus rely on certificates.

check the /etc/hosts file

Especially with Custom ROMs or on rooted devices in general, the file might have been altered. Some "ROM cooks" add the IP for Google's servers here "to speed things up" (avoiding "lookup overhead") – with the side effect being things break when those servers are "relocated".

So in that file, there might be multiple entries you need to comment out or remove (check first if that's the case – if not, you can save yourself the trouble). Leave only the local host entry as is. You'll need to remount the system partition read/write to modify this file--, which requires root access. This can be done either via adb shell from your computer, or with a terminal app directly on the device:


$ cat /system/etc/hosts # first check if the work below needs to be done. If so:
$ su
# mount -o remount,rw /system
# cd /system/etc
# cp hosts hosts.bak
# echo "127.0.0.1 localhost" > hosts


Now see if it works again. If not, you can always restore your original hosts file (note we copied it to hosts.bak). When done, don't forget to remount /system read/write again – either by a reboot, or with mount -o remount,ro /system.