Leak reference chain from the LeakCanary dump:
mAdView = new PublisherAdView(this);
mAdView.setClipChildren(true);
String adUnitId = "<removed>";
mAdView.setAdUnitId(adUnitId);
mAdView.setAdSizes(AdSize.BANNER);
ViewGroup.LayoutParams adLayout = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
mAdView.setLayoutParams(adLayout);
PublisherAdRequest.Builder adRequestBuilder = new PublisherAdRequest.Builder();adsLayout = (ViewGroup) findViewById(R.id.debug_ads_layout);
adsLayout.addView(mAdView);mAdView.loadAd(adRequestBuilder.build());And this is the cleanup code called from within the Activity's onDestroy() method.mAdView.pause();
mAdView.destroy();
adsLayout.removeAllViews();
Hi,
Same leak seems to occur consistently on Nexus 5 as well, using both AdView or PublisherAdView :(
Waiting forward to reading from dev team.
Play Services 7.5.0
In com.removed:1.2.4:1.
* removed.Activity has leaked:
* GC ROOT com.google.android.gms.ads.internal.request.q.a
* references com.google.android.gms.ads.internal.request.m.b
* leaks removed.Activity instance
* Reference Key: 0ff598c3-885d-45b5-a9a7-1a2b358e5429
* Device: LGE google Nexus 5 hammerhead
* Android Version: 5.1 API: 22 LeakCanary: 1.3.1
* Durations: watch=5018ms, gc=225ms, heap dump=9844ms, analysis=27696ms
* Details:
* Instance of com.google.android.gms.ads.internal.request.q
| a = com.google.android.gms.ads.internal.request.m [id=0x13bfa880]
| mDescriptor = java.lang.String [id=0x12daf0e0]
| mObject = -1361419888
| mOwner = com.google.android.gms.ads.internal.request.q [id=0x13cc7040]
* Instance of com.google.android.gms.ads.internal.request.m
| a = com.google.android.gms.ads.internal.request.n [id=0x13204dc0]
| b = removed.Activity [id=0x12e94180]
| c = com.google.android.gms.ads.internal.request.AdRequestInfoParcel [id=0x133a93d0]
| d = com.google.android.gms.ads.internal.request.c [id=0x13bd07c0]
| e = java.lang.Object [id=0x13015bd0]
| a = com.google.android.gms.ads.internal.request.AdRequestInfoParcel [id=0x133a93d0]
| b = com.google.android.gms.ads.internal.request.c [id=0x13bd07c0]
| c = java.lang.Object [id=0x13015bb0]
| d = com.google.android.gms.ads.internal.request.AdResponseParcel [id=0x13302180]
| i = com.google.android.gms.ads.internal.util.b [id=0x13015ba0]
| j = java.lang.Thread [id=0x13627f40]