title: Google Map is not getting loaded in Android native app
body: <p>I tried Google map with android app, but my effort went futile. I even went through many question for the same issue in Stackoverflow , but none of the answers solved my problem. So I am reposting the questions once again with hope of getting my issue solved.</p>
  
  <p>I followed the this tutorial(<a href="http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/" rel="nofollow">http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/</a>) for designing my app.</p>
  
  <p>Code:
  MainActivity.java</p>
  
  <pre><code>package com.example.hopemap;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.widget.Toast;
  
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  
  public class MainActivity extends Activity {
  
  private GoogleMap googleMap;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      try {
          // Loading map
          initilizeMap();
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  private void initilizeMap() {
      if (googleMap == null) {
          googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                  R.id.map)).getMap();
  
          // check if map is created successfully or not
          if (googleMap == null) {
              Toast.makeText(getApplicationContext(),
                      "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                      .show();
          }
      }
  }
  @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>}</p>
  
  <p>Manifest.xml</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.hopemap"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  &lt;meta-data android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /&gt;
  &lt;meta-data
  android:name="com.google.android.maps.v2.API_KEY"
  android:value="key"/&gt;
  &lt;uses-sdk
      android:minSdkVersion="12"
      android:targetSdkVersion="19" /&gt;
  
  &lt;permission
        android:name="com.example.hopemap.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/&gt;
      &lt;uses-permission android:name="com.example.hopemap.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.hopemap.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;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Layout.xml</p>
  
  <pre><code>    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_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>Logfile from LogCat</p>
  
  <pre><code>01-05 19:44:03.792: D/AndroidRuntime(22917): Shutting down VM
  01-05 19:44:03.792: W/dalvikvm(22917): threadid=1: thread exiting with uncaught exception (group=0x4150d930)
  01-05 19:44:03.802: E/AndroidRuntime(22917): FATAL EXCEPTION: main
  01-05 19:44:03.802: E/AndroidRuntime(22917): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hopemap/com.example.hopemap.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread.access$700(ActivityThread.java:150)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.os.Handler.dispatchMessage(Handler.java:99)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.os.Looper.loop(Looper.java:137)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread.main(ActivityThread.java:5283)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at java.lang.reflect.Method.invoke(Method.java:511)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at dalvik.system.NativeStart.main(Native Method)
  01-05 19:44:03.802: E/AndroidRuntime(22917): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:710)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:364)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.Activity.setContentView(Activity.java:1930)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.example.hopemap.MainActivity.onCreate(MainActivity.java:17)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.Activity.performCreate(Activity.java:5283)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    ... 11 more
  01-05 19:44:03.802: E/AndroidRuntime(22917): 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;
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.internal.q.v(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.internal.q.u(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.MapFragment$b.cE(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.dynamic.a.a(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.app.Activity.onCreateView(Activity.java:4871)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:686)
  01-05 19:44:03.802: E/AndroidRuntime(22917):    ... 21 more
  </code></pre>
  
  <p>While running the app on my phone, the screen appears white and the following message appears "Unfortunately HopeTest has stopped".  Please help me out. </p>