Package manager has died while checking permission Caused by: java.lang.RuntimeException: Package manager has died at android.app.ApplicationPackageManager.checkPermission(ApplicationPackageManager.java:427)
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
Can anyone help me what does this mean and how to prevent this?
A DeadObjectException can occur if two Android processes are communicating with each other and one of them dies while transferring data to the other. The other process will then throw a DeadObjectException.
In your case the &quot;other&quot; process was the PackageManager process which was communicating to a second process - may be a system service for listing packages?
There is not an easy solution how to prevent such an error. The only chance you have is by checking the adb logcat output for errors when you access the package manager.
The reason why the other process (whatever process it is) fails may be corrupt data.