title: Error while implementing Google Maps Android API V2 - SupportMapFragment cannot be resolved
body: <p>Android 2.3.3</p>
  
  <p>I have read a lot of questions on the same issue, but the more I read the more I get confused. So, I am putting my problem here, please bear if its a duplicate, but I really can't figure it out.</p>
  
  <pre><code>I have minSdkVersion=8 and targetSdkVersion=17 and 
  I am targeting devices from Android version 2.2 and above
  </code></pre>
  
  <p>Here is the list of things I have done :</p>
  
  <ol>
  <li>Signed up for Google API Console - Got API Key - Turned on Google Maps Android API V2.</li>
  <li>Imported google-play-services_lib into the project, added it as a library.</li>
  <li>Since I am targeting Versions below 3.0, I have read some where that I should be using ActionbarSherlock, So I imported that as well and added it as a library.</li>
  </ol>
  
  <p>Please look at the screenshots and the code below and let me know, where I am going wrong.
  I have read that, I need to use "SupportMapFragment" in XML and "extend FragmentActivity" in the class file, but I am not getting it to work correctly.</p>
  
  <p><img src="https://i.stack.imgur.com/S64Lb.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/CI3jb.png" alt="enter image description here"></p>
  
  <p>AndroidManifest.XML</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.xx.xxx"
          android:versionCode="1"
          android:versionName="1.0" &gt;
  
          &lt;uses-sdk
              android:minSdkVersion="8"
              android:targetSdkVersion="17" /&gt;
  
          &lt;permission
              android:name="com.xx.xxx.permission.MAPS_RECEIVE"
              android:protectionLevel="signature" /&gt;
  
          &lt;uses-feature
              android:glEsVersion="0x00020000"
              android:required="true" /&gt;
  
          &lt;uses-permission android:name="com.xx.xxx.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:name=".xxxApp"
              android:allowBackup="true"
              android:icon="@drawable/ic_launcher"
              android:label="@string/appName" &gt;
              &lt;uses-library android:name="com.google.android.maps" /&gt;
  
              &lt;activity
                  android:name=".SplashActivity"
                  android:screenOrientation="portrait"
                  android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" &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;
  
  //All Activities are declared here, including the MapsActivity
  
              &lt;!-- Google Maps APIV2  Key --&gt;
              &lt;meta-data
                  android:name="com.google.android.maps.v2.API_KEY"
                  android:value="My_API_KEY(Removed)" /&gt;
  
          &lt;/application&gt;
  
      &lt;/manifest&gt;
  </code></pre>
  
  <p>maps.xml</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;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content" &gt;
  
              &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:contentDescription="@string/imageDescription"
                  android:scaleType="fitXY"
                  android:src="@drawable/nav_bar_background" /&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_centerInParent="true"
                  android:text="@string/map"
                  android:textColor="#FFFFFF"
                  android:textSize="20sp"
                  android:textStyle="bold" /&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;fragment
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
  //changed this to support versions &lt; 3.0
              class="com.google.android.gms.maps.SupportMapFragment" /&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>MapsActivity.xml</p>
  
  <pre><code>    public class MapsActivity extends FragmentActivity {
          private MapView mapView;
          private GoogleAnalyticsTracker tracker;
          private GeoPoint point;
          private OverlayItem overlayitem;
  
          static final LatLng hacc_position = new LatLng(25.981343, -80.161756);
          //static final LatLng KIEL = new LatLng(53.551, 9.993);
          private GoogleMap map;
  
          @Override
          protected void onCreate(Bundle bundle) {
              super.onCreate(bundle);
              setContentView(R.layout.maps);
  
    **//Error at below line :  SupportMapFragment cannot be resolved**
  
              map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                      .getMap();
  
              Marker hacc = map.addMarker(new MarkerOptions().position(hacc_position)
                      .title("XYZ"));
  
              // Move the camera instantly to hacc with a zoom of 15.
              map.moveCamera(CameraUpdateFactory.newLatLngZoom(hacc_position, 15));
  
              // Zoom in, animating the camera.
              map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
              }
  </code></pre>
  
  <p>I am not sure on how to get this issue resolved. I have to support devices from Version 2.2 and above and thats mandatory.</p>
  
  <p>Can someone please help.</p>
  
  <p>I am not able to execute the project as I have error at </p>
  
  <pre><code>map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                          .getMap();
  </code></pre>
  
  <p>Let me know, if you need any info.</p>
  
  <p>Problems Screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/HJmxz.png" alt="enter image description here"></p>
  
  <p>Thanks for the help!!!</p>
  
  <p>As per suggestion of CommonsWare, I have imported the package and the error is gone. When I run the application, I get a ClassNotFoundException. Please have a look at the logcat trace.</p>
  
  <pre><code>06-26 17:27:15.759: E/Crittercism(19853): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.xxx/com.xx.xxx.MapsActivity}: android.view.InflateException: Binary XML file line #28: Error inflating class fragment
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.os.Handler.dispatchMessage(Handler.java:99)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.os.Looper.loop(Looper.java:130)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread.main(ActivityThread.java:3687)
  06-26 17:27:15.759: E/Crittercism(19853):   at java.lang.reflect.Method.invokeNative(Native Method)
  06-26 17:27:15.759: E/Crittercism(19853):   at java.lang.reflect.Method.invoke(Method.java:507)
  06-26 17:27:15.759: E/Crittercism(19853):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
  06-26 17:27:15.759: E/Crittercism(19853):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
  06-26 17:27:15.759: E/Crittercism(19853):   at dalvik.system.NativeStart.main(Native Method)
  06-26 17:27:15.759: E/Crittercism(19853): Caused by: android.view.InflateException: Binary XML file line #28: Error inflating class fragment
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  06-26 17:27:15.759: E/Crittercism(19853):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.Activity.setContentView(Activity.java:1657)
  06-26 17:27:15.759: E/Crittercism(19853):   at com.waspmobile.haccoclc.MapsActivity.onCreate(MapsActivity.java:54)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  06-26 17:27:15.759: E/Crittercism(19853):   ... 11 more
  06-26 17:27:15.759: E/Crittercism(19853): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.xx.xxx-1.apk]
  06-26 17:27:15.759: E/Crittercism(19853):   at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
  06-26 17:27:15.759: E/Crittercism(19853):   at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
  06-26 17:27:15.759: E/Crittercism(19853):   at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.createView(LayoutInflater.java:471)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
  06-26 17:27:15.759: E/Crittercism(19853):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
  06-26 17:27:15.759: E/Crittercism(19853):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
  06-26 17:27:15.759: E/Crittercism(19853):   ... 20 more
  06-26 17:27:15.959: E/AndroidRuntime(19853): FATAL EXCEPTION: main
  06-26 17:27:15.959: E/AndroidRuntime(19853): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.xxx/com.xx.xxx.MapsActivity}: android.view.InflateException: Binary XML file line #28: Error inflating class fragment
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.os.Handler.dispatchMessage(Handler.java:99)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.os.Looper.loop(Looper.java:130)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread.main(ActivityThread.java:3687)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at java.lang.reflect.Method.invokeNative(Native Method)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at java.lang.reflect.Method.invoke(Method.java:507)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at dalvik.system.NativeStart.main(Native Method)
  06-26 17:27:15.959: E/AndroidRuntime(19853): Caused by: android.view.InflateException: Binary XML file line #28: Error inflating class fragment
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.Activity.setContentView(Activity.java:1657)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at com.xx.xxx.MapsActivity.onCreate(MapsActivity.java:54)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    ... 11 more
  06-26 17:27:15.959: E/AndroidRuntime(19853): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.xx.xxx-1.apk]
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.createView(LayoutInflater.java:471)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
  06-26 17:27:15.959: E/AndroidRuntime(19853):    ... 20 more
  </code></pre>
  
  <p>Order and Export tab</p>
  
  <p><img src="https://i.stack.imgur.com/hh3js.png" alt="enter image description here"></p>