可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Currently we are experiencing a DeadSystemException in our HockeyApp crash reporting. It occures on Android 7.0 and Android 7.1. We don't experience this exception in previous version of our application (they are currently both used by users), so I guess this exception is caused by some code change. But stack trace is not wery helpful for this. Any idea? Thanks for any sugestion.
Stack trace from HockeyApp:
java.lang.RuntimeException: android.os.DeadSystemException at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3781) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: android.os.DeadSystemException ... 8 more
回答1:
The Android Developer docs for android.os.DeadSystemException say 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.
回答2:
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.