Crash log
07-25 21:06:58.478 18718-18718/? W/System.err: java.lang.IllegalAccessException: java.lang.Class<com.android.internal.os.RuntimeInit$UncaughtHandler> is not accessible from java.lang.Class<com.zxy.recovery.c.a>
07-25 21:06:58.479 18718-18718/? W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at com.zxy.recovery.c.a.a(MyApplication:26)
at com.zxy.recovery.c.a.a(MyApplication:37)
at com.zxy.recovery.core.c.uncaughtException(MyApplication:99)
at com.tencent.bugly.crashreport.crash.f.b(MyApplication:354)
at com.tencent.bugly.crashreport.crash.f.uncaughtException(MyApplication:372)
at com.amap.api.a.a.iv.uncaughtException(Unknown Source)
at com.amap.api.a.a.jm.uncaughtException(Unknown Source)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
07-25 21:06:58.651 19636-19636/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.plusmoney.managerplus:recover, PID: 19636
java.lang.RuntimeException: Unable to start service com.zxy.recovery.core.RecoveryService@c36d447 with Intent { cmp=com.plusmoney.managerplus/com.zxy.recovery.core.RecoveryService (has extras) }: com.zxy.recovery.b.a: The context is not initialized
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3495)
at android.app.ActivityThread.-wrap23(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1674)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Caused by:
我们为应用的正式版开启了静默恢复,结果不生效;在开发版上使用非静默恢复是生效的。
代码如下:
Recovery.getInstance()
.debug(IS_DEV)
//开发版开启调试页面,生产版启用静默恢复
.silent(!IS_DEV, Recovery.SilentMode.RECOVER_TOP_ACTIVITY)
.recoverInBackground(false)
.init(appContext);
这个应该与Android8.0的Service机制相关吧?
在 Android 8.0 之前,创建前台服务的方式通常是先创建一个后台服务,然后将该服务推到前台。
Android 8.0 有一项复杂功能;系统不允许后台应用创建后台服务。 因此,Android 8.0 引入了一种全新的方法,即 Context.startForegroundService(),以在前台启动新服务。
在系统创建服务后,应用有五秒的时间来调用该服务的 startForeground() 方法以显示新服务的用户可见通知。
如果应用在此时间限制内未调用 startForeground(),则系统将停止服务并声明此应用为 ANR。
Crash log
我们为应用的正式版开启了静默恢复,结果不生效;在开发版上使用非静默恢复是生效的。
代码如下:
这个应该与Android8.0的Service机制相关吧?