title: unfortunately app has stopped working, first android app, using google maps api
body: <p>Making my first android app, just followed the instructions on the <a href="https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key" rel="nofollow">google maps api version 2 official site</a> step by step. Did everything as it said. Including getting the api key, making emulators, installing all the SDK, google services etc.. Not sure why I get an error message as soon as I attempt to start the application: "Unfortunately googleMaps has stopped working". </p>
  
  <p>Can't say the error output is very helpful to me as this is my first android app. I could use some guidance.</p>
  
  <p>Here is LogCat output: </p>
  
  <pre><code>    09-15 11:26:39.755: I/Process(959): Sending signal. PID: 959 SIG: 9
  09-15 11:26:42.685: D/AndroidRuntime(972): Shutting down VM
  09-15 11:26:42.685: W/dalvikvm(972): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
  09-15 11:26:42.715: E/AndroidRuntime(972): FATAL EXCEPTION: main
  09-15 11:26:42.715: E/AndroidRuntime(972): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MapActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.os.Handler.dispatchMessage(Handler.java:99)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.os.Looper.loop(Looper.java:137)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread.main(ActivityThread.java:4340)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at java.lang.reflect.Method.invokeNative(Native Method)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at java.lang.reflect.Method.invoke(Method.java:511)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at dalvik.system.NativeStart.main(Native Method)
  09-15 11:26:42.715: E/AndroidRuntime(972): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Activity.setContentView(Activity.java:1835)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at com.example.googlemaps.MapActivity.onCreate(MapActivity.java:12)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Activity.performCreate(Activity.java:4465)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
  09-15 11:26:42.715: E/AndroidRuntime(972):  ... 11 more
  09-15 11:26:42.715: E/AndroidRuntime(972): 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
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Fragment.instantiate(Fragment.java:572)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Fragment.instantiate(Fragment.java:540)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Activity.onCreateView(Activity.java:4235)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
  09-15 11:26:42.715: E/AndroidRuntime(972):  ... 20 more
  09-15 11:26:42.715: E/AndroidRuntime(972): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment
  09-15 11:26:42.715: E/AndroidRuntime(972):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  09-15 11:26:42.715: E/AndroidRuntime(972):  at android.app.Fragment.instantiate(Fragment.java:562)
  09-15 11:26:42.715: E/AndroidRuntime(972):  ... 23 more
  09-15 11:31:42.784: I/Process(972): Sending signal. PID: 972 SIG: 9
  </code></pre>
  
  <p>Didn't really add much to the application except for changing the manifest file: </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.googlemaps"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;!-- google api so we can use google maps --&gt;
      &lt;meta-data
      android:name="com.google.android.maps.v2.API_KEY"
      android:value="my api key"/&gt;
  
      &lt;!-- Internet access to download maps --&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
      &lt;!-- Network state access to check if we can access internet --&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  
      &lt;!-- save catched maps to external storage --&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  
      &lt;!-- google services --&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  
      &lt;!-- The following two permissions are not required to use
       Google Maps Android API v2, but are recommended. --&gt;
  
      &lt;!-- location based on WIFI/GSM --&gt; 
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  
      &lt;!-- location based on GPS --&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
      &lt;!-- OpenGL ES version 2 --&gt;
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="18" /&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.googlemaps.MapActivity"
              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;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>