title: How google map works with android
body: <p>Three months and I still can't get a working Google Map on my project. </p>
  
  <p>I tried a lot of tutorial's but always the same problem I can't run it and I don't know how to fix it. </p>
  
  <p>This my Manifest.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.example.androidmaphmida"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;permission
          android:name="com.example.androidmaphmida.permission.MAPS_RECEIVE"
          android:protectionLevel="signature" /&gt;
  
      &lt;uses-permission android:name="com.example.androidmaphmida.permission.MAPS_RECEIVE" /&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="11"
          android:targetSdkVersion="21" /&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&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"&gt;
          &lt;activity
              android:name="com.example.androidmaphmida.MainActivity"
              android:label="@string/app_name"
              android:theme="@style/AppBaseTheme"&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;!-- Goolge API Key --&gt;
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyBg-SzhfkXjGUDK037BbmsG4Hv3yrY6c2M" /&gt;
           &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.example.androidmaphmida.MainActivity" /&gt;
  
       &lt;meta-data
      android:name="com.google.android.gms.version"
      android:value="@integer/google_play_services_version" /&gt;
        &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>activity_main</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/map"
      android:name="com.google.android.gms.maps.MapFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p>This is my MainActivity:
      package com.example.androidmaphmida;</p>
  
  <pre><code>import android.os.Bundle;
  import android.widget.Toast;
  import android.app.Activity;
  
  import com.example.androidmaphmida.R;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  
  public class MainActivity extends Activity {
  
      // Google Map
      GoogleMap map;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          map = ((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap();
  
          //geolocalisation
          map.setMyLocationEnabled(true);
      }
  
      @Override
      protected void onResume() {
          super.onResume();
      }
  }
  </code></pre>
  
  <p>My logcat</p>
  
  <pre><code>05-04 18:58:32.773: D/AndroidRuntime(17215): Shutting down VM
  05-04 18:58:32.773: W/dalvikvm(17215): threadid=1: thread exiting with uncaught exception (group=0x40bef1f8)
  05-04 18:58:32.788: E/AndroidRuntime(17215): FATAL EXCEPTION: main
  05-04 18:58:32.788: E/AndroidRuntime(17215): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidmaphmida/com.example.androidmaphmida.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread.access$600(ActivityThread.java:128)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.os.Handler.dispatchMessage(Handler.java:99)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.os.Looper.loop(Looper.java:137)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread.main(ActivityThread.java:4514)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at java.lang.reflect.Method.invoke(Method.java:511)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at dalvik.system.NativeStart.main(Native Method)
  05-04 18:58:32.788: E/AndroidRuntime(17215): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:273)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.Activity.setContentView(Activity.java:1835)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.example.androidmaphmida.MainActivity.onCreate(MainActivity.java:19)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.Activity.performCreate(Activity.java:4465)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    ... 11 more
  05-04 18:58:32.788: E/AndroidRuntime(17215): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the &lt;application&gt; element:     &lt;meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /&gt;
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.common.GooglePlayServicesUtil.A(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.internal.u.I(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.internal.u.H(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.MapFragment$b.jz(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.dynamic.a.a(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.app.Activity.onCreateView(Activity.java:4242)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
  05-04 18:58:32.788: E/AndroidRuntime(17215):    ... 20 more
  05-04 18:58:45.413: I/Process(17215): Sending signal. PID: 17215 SIG: 9
  </code></pre>