How to handle Android ANR and crashes

Asked 2 years ago, Updated 2 years ago, 117 views

I am developing Android apps as my personal hobby.
I am distributing a browser application, but I don't understand how to deal with the following errors reported in ANR and Crash.
I would appreciate it if you could give me some tips on how to respond to errors occurring in these classes on Android.

By the way, even if I use it every day, there are no errors, so I think it will happen in an irregular case.
The OS has been reported to Android 5-7, and it doesn't seem to be concentrated on a particular OS or device.

java.lang.NullPointerException: 
  at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run (ViewRootImpl.java: 7154)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:148)
  at android.app.ActivityThread.main (ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)

android

2022-09-30 21:26

1 Answers

I think it's a problem with the framework.
↓ is Fix commit ( 8.0 or later).

https://github.com/aosp-mirror/platform_frameworks_base/commit/478cb9746a57ba8f5a596ef941c936faa7c74784

The error may occur if the process of issuing an AccessibilityEvent called TYPE_WINDOW_CONTENT_CHANGED is called multi-threaded.

https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html#TYPE_WINDOW_CONTENT_CHANGED

TYPE_WINDOW_CONTENT_CHANGED is an event that occurs when a View is added, deleted, or resized.


2022-09-30 21:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.