3

guys. I have two PublisherAdViews in project(here will be test app) with sizes BANNER and MEDIUM_RECTANGLE. BANNER size is working great,but MEDIUM_RECTANGLE is not,I can only see glimpses on the screen(like shadow pop-up) and then just screen background. AdLisneter tells me that ad is loaded and everything ok. Dont know what to do. I tried add PublisherAdViews in xml and programmatically,but have no results. Here is XML

<com.google.android.gms.ads.doubleclick.PublisherAdView
    android:id="@+id/ad_view_small"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:adUnitId="/108874508/LEBFILE-MOBILEAPP-320x50">
</com.google.android.gms.ads.doubleclick.PublisherAdView>


<com.google.android.gms.ads.doubleclick.PublisherAdView
    android:id="@+id/ad_view_big"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ads:adSize="MEDIUM_RECTANGLE"
    ads:adUnitId="/108874508/LEBFILES-300X250-HP-MOBILE">
</com.google.android.gms.ads.doubleclick.PublisherAdView>

and here is implementation

    PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
    PublisherAdView mAdView2 = (PublisherAdView) findViewById(R.id.ad_view_small);
    mAdView2.loadAd(adRequest);
    PublisherAdView mAdView1 = (PublisherAdView) findViewById(R.id.ad_view_big);
    mAdView1.loadAd(adRequest);

As you can see it's identical,but big ad just does't display. This how I tried adding ad manually,again no results.

    rlBanner = (RelativeLayout)findViewById(R.id.rlBanner);
    PublisherAdView adView = new PublisherAdView(MainActivity.this);
    adView.setAdSizes(AdSize.MEDIUM_RECTANGLE);
    adView.setAdUnitId("/108874508/LEBFILES-300X250-HP-MOBILE");
    adView.setId(999);
    adView.loadAd(adRequest);
    @SuppressWarnings("deprecation")
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
    adView.setLayoutParams(params);
    rlBanner.addView(adView);
    rlBanner.bringChildToFront(rlBanner.findViewById(999));

Thx,for reading and helping cause situation is pretty bad.

boohaky
  • 33
  • 1
  • 7
  • I have the same issue. I looked a lot of forums and looks like only this 300x250 banner has an issue with rendering. – RagnarR May 04 '16 at 14:44
  • Hi! Did you found a solution? I'm having the same problem with MEDIUM_RECTANGLE ads. I've tried everything with no luck. – MrBrightside Jul 31 '18 at 06:43

1 Answers1

0

Please change adsize= "MEDIUM_RECTANGLE" to "FLUID"

swamy jvs
  • 1
  • 1
  • 3