Сбой ActivityThread

# #java #android #firebase #android-workmanager

#java #android #firebase #android-workmanager

Вопрос:

Были некоторые ActivityThread сбои, в которых я не вижу особого смысла. Некоторые из них указывают на сторонние библиотеки, которые выполняют периодическую работу, такую как Workmanager, Firebase и т. Д. Основная причина большинства из них заключается DeadSystemException в том, что говорит The core Android system has died and is going through a runtime restart. , но так ли это распространено?

Трассировка стека 1:

 Fatal Exception: java.lang.RuntimeException: Unable to create service androidx.work.impl.background.systemjob.SystemJobService: java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3689)  at android.app.ActivityThread.access$1500(ActivityThread.java:207)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6898)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)  Caused by java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3683)  at android.app.ActivityThread.access$1500(ActivityThread.java:207)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6898)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)   

Трассировка стека 2:

 Fatal Exception: java.lang.RuntimeException: Unable to create service com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService: java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleCreateService(ActivityThread.java:4506)  at android.app.ActivityThread.access$100(ActivityThread.java:296)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2165)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:260)  at android.app.ActivityThread.main(ActivityThread.java:8245)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)  Caused by java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleCreateService(ActivityThread.java:4500)  at android.app.ActivityThread.access$100(ActivityThread.java:296)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2165)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:260)  at android.app.ActivityThread.main(ActivityThread.java:8245)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)   

Трассировка стека 3:

 Fatal Exception: java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleSleeping(ActivityThread.java:4909)  at android.app.ActivityThread.access$2700(ActivityThread.java:242)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2079)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:213)  at android.app.ActivityThread.main(ActivityThread.java:7620)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)  

Трассировка стека 4:

 Fatal Exception: java.lang.RuntimeException: Unable to unbind to service com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService@89f0968 with Intent { cmp=com.ultrahuman.android/com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService }: java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleUnbindService(ActivityThread.java:4712)  at android.app.ActivityThread.access$1800(ActivityThread.java:301)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2187)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:246)  at android.app.ActivityThread.main(ActivityThread.java:8595)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)  

Stacktrace 5:

 Fatal Exception: java.lang.RuntimeException: Unable to create service com.google.android.gms.cast.framework.media.MediaNotificationService: java.lang.NullPointerException: null reference  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3205)  at android.app.ActivityThread.-wrap5(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1568)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6124)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:890)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:780)  Caused by java.lang.NullPointerException: null reference  at java.util.Objects.requireNonNull(Objects.java:228)  at com.google.android.gms.common.internal.Preconditions.checkNotNull(Preconditions.java:2)  at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(MediaNotificationService.java:4)  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3195)  at android.app.ActivityThread.-wrap5(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1568)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6124)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:890)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:780)   

Stacktrace 6:

 Fatal Exception: java.lang.RuntimeException: Unable to unbind to service com.google.firebase.auth.api.fallback.service.FirebaseAuthFallbackService@762356d with Intent { act=com.google.firebase.auth.api.gms.service.START pkg=com.ultrahuman.android }: java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleUnbindService(ActivityThread.java:3684)  at android.app.ActivityThread.access$1500(ActivityThread.java:206)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1711)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6953)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:590)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)  Caused by java.lang.RuntimeException: android.os.DeadSystemException  at android.app.ActivityThread.handleUnbindService(ActivityThread.java:3678)  at android.app.ActivityThread.access$1500(ActivityThread.java:206)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1711)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6953)  at java.lang.reflect.Method.invoke(Method.java)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:590)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)   

This is spread across various Android versions (9 / 10 / 11). There are no repeat crashes for users as such. How do we mitigate this? Thanks!