title: Could not find class 'com.google.android.gms.maps.MapFragment'
body: <p>I know there are a lot of questions like this one, and I searched everything I could, but I wasn't able to find an answer. So, I think I did everything well, but it's still giving me this error.</p>
  
  <p>main.xml:</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" &gt;
  
  &lt;fragment
      android:id="@+id/map"
      android:name="com.google.android.gms.maps.MapFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>MainActivity.java:</p>
  
  <pre><code>package com.davidmilicevic97.testapp;
  
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.Toast;
  
  public class MainActivity extends Activity {
  
  private GoogleMap googleMap;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      try {
          initializeMap();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      initializeMap();
  }
  
  private void initializeMap() {
      if (googleMap == null) {
          googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                  R.id.map)).getMap();
  
          if (googleMap == null) {
              Toast.makeText(getApplicationContext(),
                      "Sorry! Unable to create maps.", Toast.LENGTH_SHORT)
                      .show();
          }
      }
  }
  </code></pre>
  
  <p>}</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.davidmilicevic97.testapp"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="14"
      android:targetSdkVersion="15" /&gt;
  
  &lt;permission
      android:name="com.davidmilicevic97.testapp.permission.MAPS_RECEIVE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-permission android:name="com.davidmilicevic97.testapp.permission.MAPS_RECEIVE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&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;!-- Required to show current location --&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
  &lt;!-- Required OpenGL ES 2.0. for Maps v2 --&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=".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;!-- Google API key --&gt;
      &lt;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="myKey" /&gt;
      &lt;!-- Play services version --&gt;
      &lt;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is my log, if it's needed:</p>
  
  <pre><code>    07-07 16:29:22.502: E/Trace(8412): error opening trace file: No such file or directory (2)
  07-07 16:29:22.502: E/dalvikvm(8412): Could not find class 'com.google.android.gms.maps.MapFragment', referenced from method com.davidmilicevic97.testapp.MainActivity.initializeMap
  07-07 16:29:22.502: W/dalvikvm(8412): VFY: unable to resolve check-cast 929 (Lcom/google/android/gms/maps/MapFragment;) in Lcom/davidmilicevic97/testapp/MainActivity;
  07-07 16:29:22.502: D/dalvikvm(8412): VFY: replacing opcode 0x1f at 0x000f
  07-07 16:29:23.502: E/ActivityThread(8412): Failed to inflate
  07-07 16:29:23.502: E/ActivityThread(8412): android.view.InflateException: Binary XML file line #6: Error inflating class fragment
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  07-07 16:29:23.502: E/ActivityThread(8412):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:275)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Activity.setContentView(Activity.java:1867)
  07-07 16:29:23.502: E/ActivityThread(8412):     at com.davidmilicevic97.testapp.MainActivity.onCreate(MainActivity.java:17)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Activity.performCreate(Activity.java:5008)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2139)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2210)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.ActivityThread.access$600(ActivityThread.java:142)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.os.Looper.loop(Looper.java:137)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.ActivityThread.main(ActivityThread.java:4931)
  07-07 16:29:23.502: E/ActivityThread(8412):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-07 16:29:23.502: E/ActivityThread(8412):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-07 16:29:23.502: E/ActivityThread(8412):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
  07-07 16:29:23.502: E/ActivityThread(8412):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
  07-07 16:29:23.502: E/ActivityThread(8412):     at dalvik.system.NativeStart.main(Native Method)
  07-07 16:29:23.502: E/ActivityThread(8412): 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
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Fragment.instantiate(Fragment.java:584)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Fragment.instantiate(Fragment.java:552)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Activity.onCreateView(Activity.java:4656)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
  07-07 16:29:23.502: E/ActivityThread(8412):     ... 21 more
  07-07 16:29:23.502: E/ActivityThread(8412): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment
  07-07 16:29:23.502: E/ActivityThread(8412):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  07-07 16:29:23.502: E/ActivityThread(8412):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  07-07 16:29:23.502: E/ActivityThread(8412):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  07-07 16:29:23.502: E/ActivityThread(8412):     at android.app.Fragment.instantiate(Fragment.java:574)
  07-07 16:29:23.502: E/ActivityThread(8412):     ... 24 more
  07-07 16:29:23.502: D/AndroidRuntime(8412): Shutting down VM
  07-07 16:29:23.502: W/dalvikvm(8412): threadid=1: thread exiting with uncaught exception (group=0x2b54a300)
  07-07 16:29:23.502: E/AndroidRuntime(8412): FATAL EXCEPTION: main
  07-07 16:29:23.502: E/AndroidRuntime(8412): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.davidmilicevic97.testapp/com.davidmilicevic97.testapp.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2185)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2210)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread.access$600(ActivityThread.java:142)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.os.Looper.loop(Looper.java:137)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread.main(ActivityThread.java:4931)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at dalvik.system.NativeStart.main(Native Method)
  07-07 16:29:23.502: E/AndroidRuntime(8412): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:275)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Activity.setContentView(Activity.java:1867)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at com.davidmilicevic97.testapp.MainActivity.onCreate(MainActivity.java:17)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Activity.performCreate(Activity.java:5008)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2139)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     ... 11 more
  07-07 16:29:23.502: E/AndroidRuntime(8412): 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
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Fragment.instantiate(Fragment.java:584)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Fragment.instantiate(Fragment.java:552)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Activity.onCreateView(Activity.java:4656)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     ... 21 more
  07-07 16:29:23.502: E/AndroidRuntime(8412): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     at android.app.Fragment.instantiate(Fragment.java:574)
  07-07 16:29:23.502: E/AndroidRuntime(8412):     ... 24 more
  </code></pre>
  
  <p>I imported google-play-services_lib through the Eclipse and used it as a library for my project. I think i don't have to use SupportMapFragment because my MinSdkVersion is 14. Also, I added both Google Play Services version and API key to my manifest, and I think I added all permissions I had to, so I really don't know where is the problem.</p>
  
  <p>I would be very grateful if anyone could check my problem.</p>