title: Adding AdMob ads in XML
body: <p>I'm trying to add AdMob ads to my app but when I do it, as soon as I launch my app it crashes.</p>
  
  <p>This is my XML code:</p>
  
  <pre><code>&lt;com.google.ads.AdView 
      xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
      android:id="@+id/adView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      ads:adUnitId="mydevid"
      ads:adSize="BANNER"
      ads:testDevices="mydeviceid"
      ads:loadAdOnCreate="true"/&gt;
  </code></pre>
  
  <p>Also, once I get it to work, how do I set where exactly is the ad going to be shown? Thank you</p>
  
  <p>Logcat file:</p>
  
  <pre><code>06-13 23:41:03.576: E/AndroidRuntime(17419): FATAL EXCEPTION: main
  06-13 23:41:03.576: E/AndroidRuntime(17419): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.matthewstudios.gw2legendary/com.example.gw2legendary.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class com.google.ads.AdView
  </code></pre>