[Nexus 4 Android Development] penguinchris:
Nexus 4 Google Play Services Error fix (maybe)

To those getting the Google Play Services issue (where it crashes constantly, particularly when apps use GPS) on the Nexus 4, I have a possible fix.

First of all, if you clear the Google Play Services cache, the issue goes away until the cache grows to about 200 kb again at which point the crashing resumes. So you do have the option if you don't care about apps using GPS that much and don't want to bother doing a full wipe (and reinstalling all your apps etc.), turn off GPS and clear the cache when/if occasionally you still get the crashes.

But, you can also do what I did which seems to have solved the issue for me (it's only been a couple of days so it could come back - but I've tested apps that use GPS and my play services cache is 1.65 MB right now and I've had no crashing so it seems to be fine).

In TWRP recovery:

1. Factory reset - this is essential - I tried just wiping /system to save time and it didn't work, turning into a lot of wasted time (don't need to wipe the sdcard partition obviously).

2. Install the latest Chroma ROM zip - but NOT the banks gapps linked in OP.

3. Install the GAPPS package from HERE - make sure to choose the 5.1.1 version (I also got the search box addon because I wanted that - take a look at the other addons available, some are things that will just install from the Play store but some aren't and may be things you want). I tried another minimal GAPPS package (also found here on xda) and it didn't work, FYI. I think that package and banks use a newer Play Services version, which may very well be the sole culprit of this whole issue, but I'm not sure.

4. Wipe cache/dalvik

5. Reboot, wait for all your apps etc. to reinstall and hope that it works...

6. ...and DON'T restore any system apps or system data using Titanium Backup or similar - and don't change the Android system ID as Titanium Backup prompts you to do. I'm not sure what specifically I did but in one instance of trying to fix this I restored system apps/system gapps and/or the system ID and the problem started again - if that happens you will almost certainly need to start again from the full wipe.

7. Backup/restore of Launcher3 settings (homescreen layout, except for widgets) and Chroma settings in Titanium Backup worked fine, as well as non-system apps and app data.

So - at least on the Nexus 4, there's some sort of bug in the banks gapps (perhaps specifically in the Google Play Services version included), or it's just really fragile somehow when it's all installed in the system partition on the N4. I don't know. I don't think it's kernel related, because Chroma changed the included kernel and the problem continued unchanged. But again I don't know.

We're all here because we like to have the latest and greatest (notwithstanding the fact that those of us with this issue are using now-ancient Nexus 4s) but the Chroma ROM is "focused on battery, performance and stability" so workarounds and "just don't use GPS" aren't solutions, so I hope this works for everyone else with the problem.

Chroma is the best ROM I've ever used by far and is probably the best that will ever be available for the N4 at this point - so thanks for it and thanks for continuing to support the N4 even if we have to solve some issues ourselves to get it to work just right (I know, zephiK, that you no longer have an N4 to test on and are blind-compiling for the N4).