DeadSystemException Launcher Service for Android 7

Over the past few weeks, I have a reporter:

Fatal Exception: java.lang.RuntimeException: Unable to start service com.####.MyService@ef705d8 with Intent { act=HIDE cmp=com.####/.MyService (has extras) }: java.lang.RuntimeException: android.os.DeadSystemException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3344)
       at android.app.ActivityThread.-wrap21(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1583)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6121)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

      

This glitch is present on:

  • all Samsung 7.0 devices

  • all Nexus devices on 7.1.2

Note:

  • This is not due to a recent update of our app, but only to OS updates on these phones.

  • These are very frequent crashes (by far our biggest).

  • Our users are not reporting crashes than before (is this crash actually showing to the user?)

  • We cannot reproduce it on our side

  • As you can see in the stack trace, the affected code is only the system. There isn't much that I can do on my part to try and catch and fix the problem.

I checked the Android DeadSystemException thread but it doesn't help much.

I know that DeadSystemException

:

The main Android system has died and is undergoing a restart. All running applications will be killed quickly.

Is there something we can do other than say "what a system, we can't do anything"?

+8


source to share


3 answers


When the device restarts, you cannot start the application. Any application, not just yours, but any given application cannot work when the device is restarted. AFAIK it happens when you try to do something when the system crashes. Meaning if the system crashes and when it restarts the application starts the service or does something that you get this error.

The exception value is not connected to your app, but Android OS and there is nothing you can do about it.



The failure related to starting the service is because this is what your application was doing when the system crashed.

So: An error is something that the system threw because your application was doing something when the system was performing a reboot. There is nothing you can do about it as you cannot control the Android OS from the app.

+10


source


I had the same problem. I have applied a service that uses android SensorService. Two things happened at one point in time, but I still don't know which one caused the other. 1) The startup environment has been restarted. 2) Moderate android SensorService. I applied the default exception handler because I was debugging some other things in my application. I noticed that such a handler would at least occasionally catch this exception.

I followed this tutorial to implement it https://doandroid.wordpress.com/2011/11/19/writing-crash-reports-into-device-sd-card/

So, suppose you implement this handler and in fact it is called when the system dies, you can add some kind of checks inside the handler, so if the exception is a DeadSystemException, you can set up an alarm to restart your application in let say, 5 minutes or whatever.



This is certainly not a perfect solution, but at least it can be a workaround for your problem until you understand what is happening with the system.

Some info on how to programmatically restart an application: Forcing the application to restart on first action

+1


source


Your app crashed due to the death of the Android system. Here is the link. https://developer.android.com/reference/android/os/DeadSystemException The base Android system has died and is undergoing a reboot at runtime. All running applications will be killed quickly.

0


source







All Articles