NPE Regression with Flutter 2.8+ and BannerAds
See original GitHub issueHello, we have a major problem with latest Flutter 2.8+ and BannerAds in Android < 10.
Just like it was reported in #480 but closed, when we have the app run on Androids 7,8,9 and Have Banner ads in line with the
reply by @blasten here: https://github.com/googleads/googleads-mobile-flutter/issues/269#issuecomment-884493288
await PlatformViewsService.synchronizeToNativeViewHierarchy(false);
Every action that makes the app go to background (for example clicking the ad, or sharing some content) makes the app crash.
This is in our production app.
Removing the line or Downgrading flutter seems to fix the issue but i consider this a major regression considering it was introduced by Flutter 2.8+ and it is now the recommended way of having inline ads on older devices…
Here is the example app, just run it on Old Android and click the button or the Example banner.
https://github.com/atrope/my_app
Forgot to add the LOG:
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:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1660)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1348)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6865)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:887)
at android.view.Choreographer.doCallbacks(Choreographer.java:699)
at android.view.Choreographer.doFrame(Choreographer.java:634)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:873)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6351)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5
Top GitHub Comments
Hi @atrope, Thanks for filing the issue. This seems to be the same issue as https://github.com/flutter/flutter/issues/96875, Please lets wait for the teams input on the issue filed in
flutter/flutter
. I will leave this issue open until we have an update on this. This issue triage details can be found here https://github.com/flutter/flutter/issues/96875#issuecomment-1017232275This was resolved in master, per https://github.com/flutter/flutter/issues/96875#issuecomment-1112736710