title: App with Google Map crashes when I extend FragmentActivity
body: <p>I know this question has been asked many times here, but none of the solutions provided stopped my app from crashing. </p>
  
  <p>Here is my code from the MainActivity:</p>
  
  <pre><code>package com.example.gpstracking2;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.app.Dialog;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.GooglePlayServicesUtil;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.Marker;
  
  public class MainActivity extends FragmentActivity {
  
  GoogleMap googleMap;
  
  Marker marker = null;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  }
  </code></pre>
  
  <p>Here is the code from the activity_main.xml from the layout folder:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;fragment
      android:name="com.google.android.gms.maps.SupportMapFragment"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      android:id="@+id/map"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt; 
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is 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.gpstracking2"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="17" /&gt;
  
  &lt;permission android:name="com.example.gpstracking2.permission.MAPS_RECEIVE"   android:protectionLevel="signature"/&gt;
  &lt;uses-permission android:name="com.example.gpstracking2.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;uses-feature
  android:glEsVersion="0x00020000"
  android:required="true"/&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.gpstracking2.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="KEY"/&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And here is the logcat:</p>
  
  <pre><code>10-06 16:57:27.966: W/dalvikvm(6735): VFY: unable to resolve static field 1346    (MapAttrs) in Lcom/google/android/gms/R$styleable;
  10-06 16:57:27.966: D/dalvikvm(6735): VFY: replacing opcode 0x62 at 0x000e
  10-06 16:57:27.966: D/AndroidRuntime(6735): Shutting down VM
  10-06 16:57:27.966: W/dalvikvm(6735): threadid=1: thread exiting with uncaught exception (group=0x41df3700)
  10-06 16:57:27.966: E/AndroidRuntime(6735): FATAL EXCEPTION: main
  10-06 16:57:27.966: E/AndroidRuntime(6735): java.lang.NoClassDefFoundError:   com.google.android.gms.R$styleable
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at   com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:284)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.Activity.setContentView(Activity.java:1895)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at com.example.gpstracking2.MainActivity.onCreate(MainActivity.java:25)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.Activity.performCreate(Activity.java:5133)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.os.Looper.loop(Looper.java:137)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at android.app.ActivityThread.main(ActivityThread.java:5103)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at java.lang.reflect.Method.invoke(Method.java:525)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  10-06 16:57:27.966: E/AndroidRuntime(6735):     at dalvik.system.NativeStart.main(Native Method)
  10-06 16:57:27.976: W/ActivityManager(428):   Force finishing activity com.example.gpstracking2/.MainActivity
  10-06 16:57:28.056: D/dalvikvm(428): GC_FOR_ALLOC freed 2309K, 20% free 17147K/21256K, paused 68ms, total 68ms
  10-06 16:57:28.566: W/ActivityManager(428): Activity pause timeout for ActivityRecord{42889d90 u0 com.example.gpstracking2/.MainActivity}
  10-06 16:57:28.616: I/ActivityManager(428): No longer want com.android.defcontainer (pid 5432): empty #17
  10-06 16:57:29.876: I/Process(6735): Sending signal. PID: 6735 SIG: 9
  10-06 16:57:29.876: I/ActivityManager(428): Process com.example.gpstracking2 (pid 6735) has died.
  10-06 16:57:29.896: W/InputMethodManagerService(428): Window already focused, ignoring   focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4266be70   attribute=null, token = android.os.BinderProxy@425f0da8
  </code></pre>