[Moto G Q&A, Help & Troubleshooting] neovim:
Hi,

I am using a Moto G first generation XT1032 with unlocked bootloader and custom recovery (switching between CWM touch/CWM/TWRP). I want to use CM12.1, which works fine for me except of one very important thing:

Whenever I go to "Settings -> Security" I get the message "Unfortunately, Settings has stopped".

The exact error is the following:

java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException: Attempt to invoke interface method 'int android.security.IKeystoreService.is_hardware_backed(java.lang.String)' on a null object reference
E/AndroidRuntime(14032): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3017)
E/AndroidRuntime(14032): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3048)
E/AndroidRuntime(14032): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2423)
E/AndroidRuntime(14032): at android.app.ActivityThread.access$900(ActivityThread.java:154)
E/AndroidRuntime(14032): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
E/AndroidRuntime(14032): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(14032): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(14032): at android.app.ActivityThread.main(ActivityThread.java:5289)
E/AndroidRuntime(14032): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14032): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(14032): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime(14032): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
E/AndroidRuntime(14032): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int android.security.IKeystoreService.is_hardware_backed(java.lang.String)' on a null object reference
E/AndroidRuntime(14032): at android.security.KeyStore.isHardwareBacked(KeyStore.java:318)
E/AndroidRuntime(14032): at android.security.KeyStore.isHardwareBacked(KeyStore.java:313)
E/AndroidRuntime(14032): at com.android.settings.SecuritySettings.createPreferenceHierarchy(SecuritySettings.java:262)
E/AndroidRuntime(14032): at com.android.settings.SecuritySettings.onresume(SecuritySettings.java:486)
E/AndroidRuntime(14032): at android.app.Fragment.performResume(Fragment.java:2096)
E/AndroidRuntime(14032): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:928)
E/AndroidRuntime(14032): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
E/AndroidRuntime(14032): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1049)
E/AndroidRuntime(14032): at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1879)
E/AndroidRuntime(14032): at android.app.Activity.performResume(Activity.java:6086)
E/AndroidRuntime(14032): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3006)
E/AndroidRuntime(14032): ... 11 more

The really sad thing is that exactly this error happens to me on _all_ ROMs, no matter if I use Stock ROM Kit Kat, Stock ROM 5.02 Untouched, Stock ROM 5.02 Optimized or CM 12.1. Also, it doesn't make a difference which recovery I am using, I always get the force close in security settings. It does not help to flash the GApps and it also does not help to do "Settings - Apps - All - Settings - Clear data". I use always the latest version of the recovery/the ROM/the kernel and superSU. Of course I always wipe system, data, cache and dalvik cache before installing a ROM.

I have no idea what else I could try :( Can anybody help me?

Thank you for investing your time in delivering such great soft-/firmware to us end users, I really love the works on custom ROMs/recoveries :)