Since updating my app to the latest stable version of Flutter (2.10) targeting API 31, I am seeing in Crashlytics lots of exceptions similar to this:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.dispatchWindowVisibilityChanged(int)' on a null object reference at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1619) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1619) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1619) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1619) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2646) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2143) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8665) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037) at android.view.Choreographer.doCallbacks(Choreographer.java:845) at android.view.Choreographer.doFrame(Choreographer.java:780) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
The crash occurs mostly in the background. I saw some other posts about the Google ad control, but I am not serving ads. I do display a Google map control using hybrid composition, but I have no idea if that is even related. I need some ideas on what is causing this and how to track it down.