Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when onDestroyed && Banner is Expanded #693

Open
AlexUrrutia opened this issue Jun 6, 2024 · 1 comment
Open

Memory leak when onDestroyed && Banner is Expanded #693

AlexUrrutia opened this issue Jun 6, 2024 · 1 comment

Comments

@AlexUrrutia
Copy link

if Activity is destroyed while the banner is expanded, it will throw a memory leak error:

android.view.WindowLeaked: Activity com.google.android.gms.example.bannerexample.MyActivity has leaked window android.widget.PopupWindow$PopupDecorView{d7bc3fa V.E...... R......D 0,0-1438,1477} that was originally added here (Ask Gemini)
                 	at android.view.ViewRootImpl.<init>(ViewRootImpl.java:733)
                 	at android.view.ViewRootImpl.<init>(ViewRootImpl.java:717)
                 	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:399)
                 	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
                 	at android.widget.PopupWindow.invokePopup(PopupWindow.java:1576)
                 	at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1342)
                 	at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1308)
                 	at com.google.android.gms.ads.internal.gmsg.ar.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1383)
                 	at com.google.android.gms.ads.internal.webview.r.x(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:52)
                 	at com.google.android.gms.ads.internal.webview.r.e(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:100)
                 	at com.google.android.gms.ads.internal.webview.al.run(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:25)
                 	at android.os.Handler.handleCallback(Handler.java:938)
                 	at android.os.Handler.dispatchMessage(Handler.java:99)
                 	at m.azn.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1)
                 	at com.google.android.gms.ads.internal.util.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2)
                 	at m.azn.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1)
                 	at android.os.Looper.loop(Looper.java:223)
                 	at android.app.ActivityThread.main(ActivityThread.java:7656)
                 	at java.lang.reflect.Method.invoke(Native Method)
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

banner_expanded

loadBanner method used in Banner example:

private void loadBanner() {
    // Create a new ad view.
    adView = new AdView(this);
    adView.setAdUnitId(AD_UNIT_ID);
    adView.setAdSize(getAdSize());

    // Replace ad container with new ad view.
    adContainerView.removeAllViews();
    adContainerView.addView(adView);

    Bundle extras = new Bundle();
    extras.putString("collapsible", "bottom");
    extras.putString("collapsible_request_id", UUID.randomUUID().toString());
    // Start loading the ad in the background.
    AdRequest adRequest = new AdRequest.Builder()
            .addNetworkExtrasBundle(AdMobAdapter.class, extras)
            .build();
    adView.loadAd(adRequest);
  }
@NVentimiglia
Copy link
Member

Please Report this issue to SDK Support :

https://groups.google.com/g/google-admob-ads-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants