Android应用停止运行处理策略(如 DeadSystemException)

Android应用停止运行处理策略- https://www.jianshu.com/p/c3da4681a19b
Android DeadSystemException- https://stackoverflow.com/questions/42784731/android-deadsystemexception
Android DeadSystemException- https://www.e-learn.cn/content/wangluowenzhang/189851
>  android.os.DeadSystemException:The core Android system has died and is going through a runtime restart. All running apps will be promptly killed.
1. android.os.DeadSystemException, 好像是说Android核心系统挂了,看了日志下日志,
解析原始
 java.lang.RuntimeException:android.os.DeadSystemException
 android.app.ContextImpl.checkPermission(ContextImpl.java:1664)
 ......
 Caused by:
 android.os.DeadSystemException:
 android.app.ContextImpl.checkPermission(ContextImpl.java:1664)
 android.app.ContextImpl.checkSelfPermission(ContextImpl.java:1712)
 android.content.ContextWrapper.checkSelfPermission(ContextWrapper.java:750)
 com.baidu.trace.c.e.e(Unknown Source)
 com.baidu.trace.ar.a(Unknown Source)
 com.baidu.trace.bd$b.run(Unknown Source)
 android.os.Handler.handleCallback(Handler.java:751)
 android.os.Handler.dispatchMessage(Handler.java:95)
 android.os.Looper.loop(Looper.java:154)
 com.baidu.trace.bd.run(Unknown Source)

android.os.DeadSystemException现在普遍发生在Android7.0上,是由android os抛出来的,一般是启动服务的时候catch到了异常,结果又抛出了一个新的异常,源码如下:
public RuntimeException rethrowFromSystemServer() {
        if (this instanceof DeadObjectException) {
            throw new RuntimeException(new DeadSystemException());
        } else {
            throw new RuntimeException(this);

        }

    }
暂时来看我们是什么都做不了。
可以的规避方案是:catch该exception,然后看下鹰眼服务是否启动了,若未启动则再次启动 

2. Android DeadSystemException
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

-- 涉及到Android系统API的空指针问题,使用try...catch规避问题.

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值