title: java.lang.RuntimeException: Unable to start activity ComponentInfo(Program crashes when started)
body: <p>I know this questions has already been asked hundreds of times, and it feels like I've been through them all without finding an answer.</p>
  
  <p>I've been follwing an answer on how to add a marker to googlemaps.<a href="https://stackoverflow.com/questions/14114131/how-to-add-overlay-in-google-maps-api-v2-android">How to add overlay in google maps API v2 | Android |</a></p>
  
  <p>I get no errors but when i run the app i get "program has stopped" and I get these errors in logcat:</p>
  
  <pre><code>01-08 13:22:20.658: W/dalvikvm(9338): threadid=1: thread exiting with uncaught exception (group=0x40c701f8)
  01-08 13:22:20.663: E/AndroidRuntime(9338): FATAL EXCEPTION: main
  01-08 13:22:20.663: E/AndroidRuntime(9338): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.googlemaps/com.googlemaps.MainActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class fragment
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread.access$600(ActivityThread.java:127)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.os.Handler.dispatchMessage(Handler.java:99)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.os.Looper.loop(Looper.java:137)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread.main(ActivityThread.java:4511)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at java.lang.reflect.Method.invoke(Method.java:511)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at dalvik.system.NativeStart.main(Native Method)
  01-08 13:22:20.663: E/AndroidRuntime(9338): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class fragment
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:272)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.Activity.setContentView(Activity.java:1835)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at com.googlemaps.MainActivity.onCreate(MainActivity.java:19)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.Activity.performCreate(Activity.java:4470)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     ... 11 more
  01-08 13:22:20.663: E/AndroidRuntime(9338): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.supportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.support.v4.app.Fragment.instantiate(Fragment.java:401)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     ... 21 more
  01-08 13:22:20.663: E/AndroidRuntime(9338): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.supportMapFragment
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
  01-08 13:22:20.663: E/AndroidRuntime(9338):     ... 24 more
  </code></pre>
  
  <p>Here's my main java:</p>
  
  <pre><code>package com.googlemaps;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.BitmapDescriptorFactory;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.view.Menu;
  
  public class MapActivity extends FragmentActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main); 
      LatLng sala = new LatLng(59.918434,16.618195);
  
      GoogleMap mMap;
      mMap = ((SupportMapFragment)(getSupportFragmentManager().findFragmentById(android.R.id.content))).getMap();
      mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
      mMap.addMarker(new MarkerOptions()
              .position(sala)
              .title("Här ligger sala")
              .snippet("Detta är sala")
              .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));
      mMap.getUiSettings().setCompassEnabled(true);
      mMap.getUiSettings().setZoomControlsEnabled(true);
      mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sala,10));
  
  
  }
  </code></pre>
  
  <p>And here's my xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &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=".MainActivity" &gt;
  
  &lt;fragment 
      android:id="@+id/map"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      class="com.google.android.gms.maps.supportMapFragment"
  
      /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and also 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.googlemaps"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="14"
          android:targetSdkVersion="17" /&gt;
      &lt;permission
          android:name="com.googlemaps.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/&gt;
  
      &lt;uses-permission android:name="com.googlemaps.permission.MAPS_RECEIVE" /&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.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;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;uses-library android:required="true"
              android:name="com.google.android.maps" /&gt;
          &lt;activity
              android:name="com.go8oglemaps.MapActivity"
              android:label="@string/app_name" 
              android:screenOrientation="portrait"&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;!-- adds google API key to manifest --&gt;
          &lt;meta-data 
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyDSVPzsvOratkVZoMEKa0sF_GLOtcFI7yg"
              /&gt;
      &lt;/application&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  &lt;/manifest&gt;
  </code></pre>