Solving NullPointerException at android.provider.Settings$NameValueCache.getString()

I recently starting to have this exception which prevented an Android propietary device from booting past the Android logo. It got stuck on a loop showing the Android logo over and over. The logcat reported this

E/System  (  404): java.lang.NullPointerException
E/System  (  404):     at android.provider.Settings$NameValueCache.getString(Settings.java:737)
E/System  (  404):     at android.provider.Settings$Secure.getString(Settings.java:2343)
E/System  (  404):     at android.provider.Settings$Secure.getInt(Settings.java:2411)
E/System  (  404):     at com.android.server.am.CoreSettingsObserver.populateCoreSettings(CoreSettingsObserver.java:93)
E/System  (  404):     at com.android.server.am.CoreSettingsObserver.sendCoreSettings(CoreSettingsObserver.java:70)
E/System  (  404):     at com.android.server.am.CoreSettingsObserver.(CoreSettingsObserver.java:55)
E/System  (  404):     at com.android.server.am.ActivityManagerService.installSystemProviders(ActivityManagerService.java:6709)
E/System  (  404):     at com.android.server.ServerThread.run(SystemServer.java:204)

and this

E/AndroidRuntime(  404): java.lang.NullPointerException
E/AndroidRuntime(  404):     at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:4187)
E/AndroidRuntime(  404):     at com.android.server.ServerThread.run(SystemServer.java:317

I really didn't know what was happening. Then I somehow decided to check the /system/app directory, and to my surprise, it was missing both Android's Settings and SettingsProvider APKs. So I backed them up from another device, pushed them, and voila, problem solved. Now I'm checking the installation script because somehow it is (randomly?) deleting these 2 APKs.

(This bug has been already reported by other people but I didn't see any real fix for it).

Comments

  1. Thank you, this was a good pointer! In my case, the apks were called SecSettings.apk and SecSettingsProvider.apk, and they were not missing, but corrupted (including their .odex files). Restoring from a ROM image of the same build resolved the bootloop.

    ReplyDelete

Post a Comment

Comment, motherf*cker

Popular Posts