title: AdMob makes my app crash on startup?
body: <p>I'm trying to get admob to work on my app, but everytime I add this code to my MainAcitvity.java:</p>
  
  <pre><code>    AdView mAdView = (AdView) findViewById(R.id.adView);
      AdRequest adRequest = new AdRequest.Builder().build();
      mAdView.loadAd(adRequest);
  </code></pre>
  
  <p>the app crashes immediately when I run it. 
  My app is a DrawerLayout with 4 different fragments, each containing it's own ad. I have added the exact same code for the ad as in one of my other apps, on which it works fine. </p>
  
  <p>The logcat says this:</p>
  
  <pre><code>     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.loadAd(com.google.android.gms.ads.AdRequest)' on a null object reference
          at test.testapp.MainActivity.onCreate(MainActivity.java:110)
          at android.app.Activity.performCreate(Activity.java:6010)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
  
  
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
  
  at android.app.ActivityThread.access$800(ActivityThread.java:155)
  at      
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:135)
  at android.app.ActivityThread.main(ActivityThread.java:5343)
  at java.lang.reflect.Method.invoke(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)    
  </code></pre>