title: Unable to display AdMob Banner
body: <p>I am trying to ad using AdMob to display ads at the bottom of screen.</p>
  
  <p>I added following line in my build.gradle file to get AdMob sdk:</p>
  
  <pre><code>compile 'com.google.android.gms:play-services-ads:8.4.0'
  </code></pre>
  
  <p>After then, I added AdView in XML to show ads:</p>
  
  <pre><code>&lt;com.google.android.gms.ads.AdView
          android:id="@+id/ad_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_alignParentBottom="true"
          app:adSize="BANNER"
          android:layout_gravity="bottom"
          app:adUnitId="@string/banner_ad_unit_id" /&gt;
  </code></pre>
  
  <p>Now I make a referecne of AdView using ad_view id and build AdRequest to request for ads using following lines of code:</p>
  
  <pre><code>AdView mAdView = (AdView) findViewById(R.id.ad_view);
  final AdRequest adRequest = new AdRequest.Builder()
  //  .addTestDevice("38C0F116926519A0CBAF1094898921FB")
      .build();
  
  if (mAdView != null)
      mAdView.loadAd(adRequest);
  </code></pre>
  
  <p>Everything works perfect if I uncomment <code>addTestDevice</code> function but when I try to display real ads, I am getting the following error in logcat:</p>
  
  <pre><code>12-23 17:18:02.234 13226-13226/com.abc.xyz I/Ads: Starting ad request.
  12-23 17:18:02.234 13226-13226/com.abc.xyz I/Ads: Use AdRequest.Builder.addTestDevice("38C0F116926519A0CBAF1094898921FB") to get test ads on this device.
  12-23 17:18:02.554 13226-13226/com.abc.xyz I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@42dd86b8 time:83516183
  12-23 17:18:05.694 13226-13226/com.abc.xyz D/EgretLoader: EgretLoader(Context context)
  12-23 17:18:05.694 13226-13226/com.abc.xyz D/EgretLoader: The context is not activity
  12-23 17:18:05.764 13226-13226/com.abc.xyz I/Ads: Ad finished loading.
  12-23 17:18:05.824 13226-13226/com.abc.xyz E/Ads: JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1)
  12-23 17:18:05.824 13226-13226/com.abc.xyz I/chromium: [INFO:CONSOLE(1)] "Uncaught ReferenceError: AFMA_ReceiveMessage is not defined", source:  (1)
  </code></pre>
  
  <p>After searching the issue, I tried the solutions from the below links but none of them worked for me.</p>
  
  <p><a href="https://stackoverflow.com/questions/10717358/uncaught-referenceerror-afma-getsdkconstants-is-not-defined">Uncaught ReferenceError: AFMA_getSdkConstants is not defined</a></p>
  
  <p><a href="https://stackoverflow.com/questions/33906862/interstitial-admob-doesnt-work-afma-receivemessage-is-not-defined">Interstitial Admob doesn&#39;t work : AFMA_ReceiveMessage is not defined</a></p>
  
  <p>Please suggest me what I am doing wrong or what I am missing. Thanks.</p>