title: Error inflating class com.google.ads.Adview Android
body: <p>I'm rather new to coding (I have a few apps on the market, but no games yet) I therefore decided to create a game. I made the whole game and it worked, but when I attempted to integrate Google AdMob, it all went wrong.</p>
  
  <p>Here is my main.xml (the place I want the ads)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads"
  android:id="@+id/RelativeLayout1"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" android:background="@drawable/main_bg"&gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="20dp"
      android:src="@drawable/main_title" /&gt;
  &lt;TextView
      android:id="@+id/wwwtext"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:textColor="@color/unsel"
      android:textColorHighlight="@color/sel" android:layout_marginBottom="35dp"/&gt;
  &lt;RelativeLayout
      android:id="@+id/btn_start"
      android:layout_width="450px"
      android:layout_height="150px"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true" &gt;
  
  
      &lt;ImageView
          android:id="@+id/ing_btn"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:scaleType="fitXY"
          android:src="@drawable/btn" /&gt;
  
  
  
      &lt;TextView
          android:id="@+id/text_start"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:gravity="center_horizontal"
          android:text="@string/start_game"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;com.google.ads.Adview android:id= "@+id/adView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          ads:adUnitId= "a153123c67abc55"
          ads:adSize= "BANNER"
          ads:loadAdOnCreate= "true"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is my manifest</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.benchaful.Invasion"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
  android:minSdkVersion="9"
  android:targetSdkVersion="19" /&gt;
  
  &lt;application
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name" 
      android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
      &gt;
      &lt;activity
          android:name=".MainMenu"
          android:label="@string/app_name" android:screenOrientation="sensorLandscape"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name="Game" android:screenOrientation="sensorLandscape"&gt;
      &lt;/activity&gt;
     &lt;activity android:name= "com.google.ads.AdActivity"
          android:configChanges=     "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/&gt;
     &lt;/application&gt;
  
      &lt;uses-permission android:name= "android.permission.INTERNET"/&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And this is my LogCat</p>
  
  <pre><code>03-07 08:02:53.229: E/AndroidRuntime(6633): FATAL EXCEPTION: main
  03-07 08:02:53.229: E/AndroidRuntime(6633): java.lang.RuntimeException: Unable to start     activity ComponentInfo{com.benchaful.Invasion/com.benchaful.Invasion.MainMenu}: android.view.InflateException: Binary XML file line #54: Error inflating class com.google.ads.Adview
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread.access$700(ActivityThread.java:140)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.os.Looper.loop(Looper.java:137)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread.main(ActivityThread.java:4944)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at  java.lang.reflect.Method.invokeNative(Native Method)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at java.lang.reflect.Method.invoke(Method.java:511)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at dalvik.system.NativeStart.main(Native Method)
  03-07 08:02:53.229: E/AndroidRuntime(6633): Caused by: android.view.InflateException: Binary XML file line #54: Error inflating class com.google.ads.Adview
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:318)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.Activity.setContentView(Activity.java:1924)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at com.benchaful.Invasion.MainMenu.onCreate(MainMenu.java:31)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.Activity.performCreate(Activity.java:5188)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2085)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     ... 11 more
  03-07 08:02:53.229: E/AndroidRuntime(6633): Caused by: java.lang.ClassNotFoundException: com.google.ads.Adview
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.createView(LayoutInflater.java:558)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
  03-07 08:02:53.229: E/AndroidRuntime(6633):     ... 22 more
  </code></pre>
  
  <p>I would be very grateful if anyone could tell me what has gone wrong and how to solve it.</p>
  
  <p>Thank-you</p>