title: Binary XML file line #2: Error inflating class fragment
body: <p>I'm trying to add a map in a project but I cannot because there is some error when I debug the application with the fragment. </p>
  
  <p>This is my XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/map"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            class="com.google.android.gms.maps.MapFragment"/&gt;
  </code></pre>
  
  <p>This is my .java file:</p>
  
  <pre><code>   import android.os.Bundle;
     import android.app.Activity;
  
     public class MainActivity extends Activity {
  
     @Override
        protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
        }
     }
  </code></pre>
  
  <p>And, 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.inkadroid.mapa"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="19" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true"/&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&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;meta-data
      android:name="com.google.android.gms.version"
      android:value="@integer/google_play_services_version" /&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 = ".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="My_KEY"/&gt;
  
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Also, I've added google_play_services library.</p>
  
  <p>Visit <a href="http://i61.tinypic.com/2jdjaky.jpg" rel="nofollow">http://i61.tinypic.com/2jdjaky.jpg</a></p>
  
  <p>And, I get this error. If anyone know how to solve it, please tell me. </p>
  
  <pre><code>06-02 22:21:50.615: E/AndroidRuntime(869): java.lang.RuntimeException: Unable to start activity 
  ComponentInfo{com.inkadroid.mapa/com.inkadroid.mapa.MainActivity}: 
  android.view.InflateException:     Binary XML file line #2: Error inflating class fragment
  06-02 22:21:50.615: E/AndroidRuntime(869):  at   
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
  06-02 22:21:50.615: E/AndroidRuntime(869):  at 
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  </code></pre>