Android DeadSystemException
The Android Developer docs for android.os.DeadSystemException
says the following:
The core Android system has died and is going through a runtime restart. All running apps will be promptly killed.
The source code does not help much more:
package android.os;/** * The core Android system has died and is going through a runtime restart. All * running apps will be promptly killed. */public class DeadSystemException extends DeadObjectException { public DeadSystemException() { super(); }}
Overall, it looks like this is being thrown by the OS and has nothing to do with our code.
Looking at the javadoc from the superclass, DeadObjectException
, backs this theory up:
The object you are calling has died, because its hosting process no longer exists.
One cause was a bug in the notification service of Android version 7 and 8.
It was caused by using "vibration pattern" in the notifications, which throws an ArrayOutOfBoundsException
. This leads the whole system to crash and post a DeadSystemException
.
For further details you can refer to this Medium article here.
Fatal Exception: java.lang.RuntimeException: android.os.DeadSystemException
This exception was caused in one of the apps I was developing, it occurred mostly in MI devices.
After debugging I found that I was trying to start another service (Say B) in the current service (Say A) from a background thread, but when startService(itService)
method was called the service A was already killed.
The only solution I found till now is to check if the current service A is running or not before you start another service B. Depending on your implementation you can use one of the various ways to check if a services is running from this answer.