Update: Resetting only the Google Play Services app as has been suggested didn't work for me unfortunately, because (in addition to what I've written below) the "force stop" and "uninstall updates" buttons are greyed out.
I decided to do a factory reset, and so far I haven't had any more issues with Google Play Services, but I still don't know what exactly caused these problems (probably an update).
I have a Nexus 4 with Android 5.0.1 (no custom rom), and there have been several issues for a few hours now.
It probably started yesterday when a message popped up 2-3 times (over the course of a few hours) saying that "Google Play services has stopped working".
Now, after booting the phone and getting to the lockscreen, the apps which would usually autostart don't seem to start (messaging apps, gmail, battery widget app etc.) and it doesn't even connect to a cellular network. WLAN works straight away. Sometimes these apps will start (and it connects to the cellular network) more than half an hour after booting the phone.
I've also noticed that for several minutes after booting, the list of running apps contains only Settings, Media, Google Services (not Play services!) and Google Keyboard, and after some time, if Google Play services does show up, it is constantly shown as "restarting".
After using the phone for anything between a few minutes and maybe an hour, it will freeze and not respond to any touchscreen input, sometimes saying that the launcher is not responding. Prior to freezing, it will usually start lagging heavily. It will still respond to the power button though. (turn screen on/off, show "power off" dialog)
Additionally, Google's own apps won't work even when I try to start them manually (I have tried Play Store, Maps, Gmail, YouTube, News & Weather). They either go to a blank screen or don't open at all. The system seems more likely to freeze after trying to open these apps.
I can open the settings menu, but some of the options don't work:
- About Phone > System updates: It goes to a blank screen for about a second, and then back to the "About phone" menu.
- About phone > Status: works only when connected to a cellular network, otherwise I get a dialog saying that the process com.android.phone has stopped.
(these are the ones I found not to work)
What I've tried:
Disabling the Google Play services app and replacing it with the factory version.
Doesn't work because in order to do this, I would have to disable "Android Device manager" from being a device administrator, but its checkbox stays checked even after trying to disable it.
(Is it normal that "force stop" and "uninstall updates" are greyed out for Google Play services?)
Booting in safe mode.
Works, but I get the same problems in safe mode.
Wiping the cache partition.
Works, but doesn't fix any of the issues.
What could have caused these issues? I haven't installed any new apps recently. Is there anything else I could try? If not, I guess I'll have to do a factory reset.