admob_flutter icon indicating copy to clipboard operation
admob_flutter copied to clipboard

Loading banner ads freezes the app / restarts the phone on certain devices

Open GrimDevStudio opened this issue 4 years ago • 2 comments

I've had this issue reported from quite a few users with LG Stylo 6 and T-mobile Revvl 4. Removing the banner ads fixed the problem for them. I don't have those devices so it's impossible to properly test what's going on. My Flutter version is 1.22.5 stable.

Sample code of the ad used in the app:

static buildBanner() {
    AdmobBanner banner = AdmobBanner(
      adUnitId: BANNER_UNIT_ID_ANDROID,
      adSize: AdmobBannerSize.BANNER,
      listener: (AdmobAdEvent event, Map<String, dynamic> args) {
        if (event == AdmobAdEvent.failedToLoad) {
          print("Error code: ${args['errorCode']}");
        }
      },
    );

    return Padding(
      padding: const EdgeInsets.only(top: 2.0),
      child: Center(child: banner),
    );
  }

GrimDevStudio avatar Jan 29 '21 10:01 GrimDevStudio

i have the same problem, i think it this package causes memory leak.

oguz42 avatar Mar 01 '21 14:03 oguz42

I had this issue when using with Firebase packages and a certain version of it. I fixed this problem by setting FirebaseSDKVersion in app/build.gradle Perhaps newer versions work too, but I didn't test those.

rootProject.ext { set('FlutterFire', [ FirebaseSDKVersion: '26.2.0' ]) }

javadi69 avatar Mar 16 '21 13:03 javadi69