title: Binary XML file line #8: Error inflating class fragment, Google Maps
body: <p>In this app, I am trying to add a functional V2 google map. I've looked at most of the tutorials for creating an activity, obtaining a key for the maps, and creating the xml file to try and see if I missed any step (I went through them like 4 times), and it doesn't seem like  I missed any step. </p>
  
  <p><a href="http://www.vogella.com/articles/AndroidGoogleMaps/article.html#maps_mapsview" rel="noreferrer">Here</a> is the site I used: </p>
  
  <p>When I run my app on my phone(since Google play services doesn't work on the emulator), it gives me these two errors:</p>
  
  <pre><code>  02-11 22:10:54.690: E/AndroidRuntime(4526): java.lang.RuntimeException: Unable to       start activity ComponentInfo{com.example.myfirstapp/com.example.myfirstapp.ShowActivity}:       android.view.InflateException: Binary XML file line #8: Error inflating class fragment
    02-11 22:10:54.690: E/AndroidRuntime(4526): 
  
    Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment       com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
  </code></pre>
  
  <p>Here is my activity:</p>
  
  <pre><code>package com.example.myfirstapp;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.view.Menu;
  import com.google.android.maps.*;
  import com.google.android.gms.maps.MapFragment;
  public class ShowActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_map);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.activity_map, menu);
      return true;
  }
  
  //@Override
  //protected boolean isRouteDisplayed() {
      // TODO Auto-generated method stub
      //return false;
  //}
  
      }
  </code></pre>
  
  <p>Sorry for the formatting but here is my xml file:</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"
     tools:context=".ShowActivity" &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;
  
    &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I have imported the Google API and google play services so all the imports are working, which makes me wonder why the 2nd error said MapFragment was empty.
   Manifest file code:</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.myfirstapp"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
  &lt;uses-permission android:name="android.permission.SUBSCRIBED_FEEDS_READ" /&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="com.google.android.providers.gsf.permission.READ_GSERVICES" /&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="com.example.myfirstapp.permission.MAPS_RECEIVE" /&gt;
  &lt;permission
      android:name="com.example.myfirstapp.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&gt;
  
  &lt;uses-sdk
      android:minSdkVersion="14"
      android:targetSdkVersion="15" /&gt;
  
  &lt;application
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.myfirstapp.MainActivity"
          android:label="@string/title_activity_main" &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;meta-data
              android:name="android.app.default_searchable"
              android:value=".SearchResultsActivity" /&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.myfirstapp.SearchResultsActivity"
          android:label="@string/title_activity_search_results"
          android:launchMode="singleTop" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.SEARCH" /&gt;
          &lt;/intent-filter&gt;
  
          &lt;meta-data
              android:name="android.app.searchable"
              android:resource="@xml/searchable" /&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.myfirstapp.AddContacts"
          android:label="@string/title_activity_add_contacts" &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="com.example.myfirstapp.ContactActivity"
          android:label="@string/title_activity_contact" &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="com.example.myfirstapp.DisplayInfo"
          android:label="@string/title_activity_display_info" &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;provider
          android:name="com.example.myfirstapp.SomeProvider"
          android:authorities="com.example.myfirstapp.SomeProvider" &gt;
      &lt;/provider&gt;
  
      &lt;activity
          android:name="com.example.myfirstapp.EditContacts"
          android:label="@string/title_activity_edit_contacts" &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="com.example.myfirstapp.DeleteContact"
          android:label="@string/title_activity_delete_contact" &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="com.example.myfirstapp.FlightInfo"
          android:label="@string/title_activity_flight_info" &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="com.example.myfirstapp.EventInfo"
          android:label="@string/title_activity_event_info" &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="com.example.myfirstapp.ContactsActivity"
          android:label="@string/title_activity_contacts" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.myfirstapp.ShowActivity"
          android:label="@string/title_activity_map" &gt;
      &lt;/activity&gt;
  
      &lt;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="removed" /&gt;
  &lt;uses-library android:name="com.google.android.maps" /&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>