title: Android: Unable to start activity ComponentInfo{/com.}: android.view.InflateException: Binary XML file line Error inflating class fragment
body: <p>I created first version of my application using Google Maps Android v1 API. But now When I released my application for second version, Google map stopped working. I think it's because of it's deprecated.</p>
  
  <p>So now I'm trying to create sample Android application to use Google Map using link</p>
  
  <pre><code>https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
  </code></pre>
  
  <p>But I'm getting below force close error</p>
  
  <pre><code>FATAL EXCEPTION: main
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testmap/com.example.testmap.MainActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class fragment
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:130)
  at android.app.ActivityThread.main(ActivityThread.java:3687)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:507)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class fragment
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
  at android.app.Activity.setContentView(Activity.java:1657)
  at com.example.testmap.MainActivity.onCreate(MainActivity.java:12)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  ... 11 more
  Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.example.testmap-1.apk]
  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at android.view.LayoutInflater.createView(LayoutInflater.java:471)
  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
  ... 20 more
  </code></pre>
  
  <p>My Activity code is </p>
  
  <pre><code>package com.example.testmap;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  
  public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>
  
  <p>My xml file code is</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity" &gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/hello_world" /&gt;
  
  &lt;fragment
      android:id="@+id/map"
      android:name="com.google.android.gms.maps.MapFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>My manifest file is</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.example.testmap"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="9"
      android:targetSdkVersion="17" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&gt;
  
  &lt;permission
      android:name="android.os.Bundle.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.testmap.MainActivity"
          android:label="@string/app_name" &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;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="AIzaSyCdAP9Sa6lOBZkvn6yOuoEc7JeqM3nPY" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please help me, I'm not able to run a simple application using this new Google Map API</p>