'Android app frequently crashes with "android.view.ViewRootImpl.checkThread (ViewRootImpl.java:10750)" error

We were using Cordova 8 for development of the app. Recently android app crashing frequently with below crash report in firebase. We integrated firebase crashlytics. The app crashes while taking photos from camera/gallery (not every time).

Fatal Exception:

android.view.ViewRootImpl$CalledFromWrongThreadException Only the original thread that created a view hierarchy can touch its views. android.view.ViewRootImpl.checkThread (ViewRootImpl.java:10750)

Below are technical specifications:

  1. Cordova version 8.1.2 ([email protected])
  2. android platform - android 10.1.1

Note: We can upgrade cordova version but there will be so many issues arises which we don't want as it affects the live users.

Any plugin update required or workaround?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source