Show Map in Android

Earlier we studied about how to get current geographic location using an android application. That Android app will return latitude and longitude pair to represent current location. Instead of simply showing these location as coordinates in an android application, it would be cool if we tile these coordinates on top of a map fragment.

In this Android tutorial, lets see about how to show a map in Android. Following are the steps that needs to be done.

  1. Download and configure Google Map API.
  2. Get certificate fingerprint of android application.
  3. Create API project for the Android application.
  4. Get Google Maps API key
  5. Android manifest settings

Download and Configure Google Map API

We can download and install Google Map API using Android SDK manager. This API is provided with Google Play Services packages. So we need to run SDK manager to select this package that can be found under SDK package Extras as shown in the following figure.

Install Google Play Services

install_google_play_services

After installing, we should restart eclipse and should import this Google play services project into our Eclipse work space as a library to add reference to the dependency JAR files with our Android map application.

Get Certificate Fingerprint of Android Application.

Certificate finger print is needed to get new Android API key for our application. Application’s certificates are created in two mode.(i.e.) debug mode and release mode. To create a debug mode certificate, we need not sign it using a private key. It can be signed by the build tools with a special key created by the Android SDK build tools. The release certificate will be created when we export our application for release and should be signed by a private key.

Ads by Google

Getting Debug Certificate Fingerprint

To get certificate finger print in debug mode, we can use the existing keystore debug.keystore file. The location is varies based on the operating system. For example, in Windows, this file will be located where .android is located.

After locating the keystore, then it’s time to enter the following line into the command prompt by replacing the keystore path. We are using the keytool utility provided with the JDK.

> keytool -list -v -keystore "C:\Users\\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

Then, the certificate information will be shown in the command prompt as follows. And the required fingerprint is highlighted here.

Alias name: androiddebugkey
Creation date: Jun 11, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 7cf30c70
Valid from: Tue Jun 11 13:33:48 IST 2013 until: Thu Jun 04 13:33:48 IST 2043
Certificate fingerprints:
MD5:  6E:B7:E4:9D:2A:02:99:80:57:74:D0:59:96:F1:9B:D5
SHA1: B9:04:03:98:54:81:65:17:0C:88:23:B2:CC:37:13:E3:77:81:E7:E6
SHA256: 4E:30:62:47:98:4C:D7:A6:F2:6B:2C:FA:1B:4D:63:01:3F:44:FF:3C:65:61:33:EF:7F:73:CF:1B:86:E3:0B:17
Signature algorithm name: SHA256withRSA
Version: 3

Getting Release Certificate Fingerprint

Let us enter the following line in command prompt by replacing keystore-name and alias-name as per our application.

keytool -list -v -keystore keystore_name -alias alias_name

Create API project for our map Android application.

After getting the application’s certificate finger print by signing our application using, any one of the available modes as we discussed in previous step, this finger print will be used to create new Android API key.

DOWNLOAD: Show Android Map App Source

For that a console page provided by Google is used. Let us visit the Google API Console page to create new API project for our android application.

If we are creating our first API project, then we should click Create Project from left panel and should accept terms and conditions for this first time only. Otherwise, all created projects are listed with the drop down box which also contains Create link to add subsequent new API project.

After that, the next step is to enable the required services that will be listed on selecting services option from left panel. Now, it’s time to create android API key.

enable_google_maps_Android_api_v2

Get Google Maps API key

Google maps API key will be created by selecting API Access->Create New Android key. It will open a wizard which contains an input control to enter the certificate fingerprint that we got from step 2 and the name of our android application’s package separated with semicolon. For example,

API_access

configure_android_key

And then, the console will respond with set of keys generated. From them, we can copy API key with 40 characters next to Key for Android apps (with certificates) caption.

Android Manifest Settings

And Finally, we can start coding with our application that is for showing map into our Android device. For that, some set of permissions are provided with Android manifest file.

First, API key that is given with the Google console response is added within <application>…</application> tags of manifest file as shown below.

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="<api-key>" />
</pre>
<p>And then, the permissions are added using <permission> and <uses-permission> as follows. These are used for having internet access and also for getting other service, provider access for our application .</p>
<pre class="prettyprint lang-xml">
<permission
android:name="com.javapapers.android.mymap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="com.javapapers.android.mymap.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />	

After setting Android APT key and permission to manifest, a reference should be added for OpenGL ES version since Google Maps API require this specification for supporting map related application. For example,

<manifest>
...
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
...
</manifest>

Example: Showing Map Fragment using Android

This example project will be run using Android devices lower than 10 also. For that, we are using SupportMapFragment class instead of MapFragment to show map into the layout. So the layout file contains the following lines.

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>

And then, we are using GoogleMap for creating map instance. For this instance, a reference is added to denote the obtained map fragment using getSupportFragmentManager(). For that, we are importing GoogleMap and SupportMapFragment classes provided as part of com.google.android.gms.maps package. The following code is for this Android Activity to obtain map.

package com.javapapers.android.mymap;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class MainActivity extends FragmentActivity {
private GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (map == null) {
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
}
}
}

Android Map Output

Android Map

DOWNLOAD: Show Android Map App Source

This Android tutorial was added on 13/06/2013.

«

»

21 Responses to “Show Map in Android”

  1. Rashi.. says:

    Nice one.. Thank u..

  2. Muhammad Zahab Ahmed says:

    Thanks Alot…..

  3. Harsha says:

    Well explained procedure joe.

    Thank you

  4. shishram says:

    Hi Joe,

    i want to show route between two points(latlng) with driving direction. i’m getting only straight line between those two points but having issue to showing right route! pls help

    thanks in advance for your time and consideration.

  5. Alaa Agha Karss says:

    i would like to thank over and over for this amazing design and content tutorials :)

  6. Java Jobs in India says:

    Hi Joe,

    Nice article and it will be very useful for Android Developer.

    Many Thanks
    S.Suresh

  7. Anonymous says:

    It saved me a lot of time!
    Thanks!

  8. Amardeep says:

    Respected Sir,

    I have a project in android which i send data to a php api by post method and receive a message. But when i debug my project it give me error the android.jar file has no source attachment …Pls help asap

  9. Ajay Roy says:

    Thanks Joe for this article,
    I followed all the steps as you mentioned, applicaton opens on my phone but with the blank map, i am not sure what is the issue.

    my phone android version is 4.0.4.

    please help me .

    • Bill says:

      Good Tutorial. Thanks a lot ;) This is the first tutorial, which explains directly how to get the SHA1 key and what you have to change in the manifest.

      @Ayay Roy I also had a blank map, but wenn I cleaned the project and removed the app from the smartphone and tried it again then it worked fine ;)

  10. android freak says:

    Thanks a lot….your tutorials are simple and clear..It has been a life saver for me many times..

    When i executed this code i got an exception saying…..”Binary xml line…Error inflating class fragment”.However i resolved it when i added

    inside the application tag of manifest…

  11. android freak says:

    Thanks a lot….your tutorials are simple and clear..It has been a life saver for me many times..

    When i executed this code i got an exception saying…..”Binary xml line…Error inflating class fragment”.However i resolved it when i added inside the application tag of manifest…

  12. gagan says:

    In this what should be the keystore_name name?
    keytool -list -v -keystore keystore_name -alias alias_name

  13. Aditya Bhardwaj says:

    I also get the Binary XML error

  14. […] This Android tutorial will help a beginner to start with Google Maps on an Android device. We will be using Google Maps Android API V2 and it is an introductory level tutorial. We will show some chosen locations in Google map using Latitude and Longitude and draw lines (polyline) between them. This is continuation of the earlier written tutorial to show a map using Google Maps Android API. […]

  15. Nick Halden says:

    application stops uexpectedly..i see no errors /warning before compiling.log cat report:

    04-06 01:17:50.915: E/dalvikvm(29215): Could not find class ‘com.google.android.gms.maps.SupportMapFragment’, referenced from method com.javapapers.android.mymap.MainActivity.onCreate
    04-06 01:17:50.915: W/dalvikvm(29215): VFY: unable to resolve check-cast 543 (Lcom/google/android/gms/maps/SupportMapFragment;) in Lcom/javapapers/android/mymap/MainActivity;
    04-06 01:17:50.915: D/dalvikvm(29215): VFY: replacing opcode 0x1f at 0×0016
    04-06 01:17:50.915: D/dalvikvm(29215): VFY: dead code 0×0018-001d in Lcom/javapapers/android/mymap/MainActivity;.onCreate (Landroid/os/Bundle;)V
    04-06 01:17:50.975: D/dalvikvm(29215): GC_EXTERNAL_ALLOC freed 53K, 50% free 2727K/5379K, external 0K/0K, paused 45ms
    04-06 01:17:51.005: D/AndroidRuntime(29215): Shutting down VM
    04-06 01:17:51.005: W/dalvikvm(29215): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
    04-06 01:17:51.020: E/AndroidRuntime(29215): FATAL EXCEPTION: main
    04-06 01:17:51.020: E/AndroidRuntime(29215): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.javapapers.android.mymap/com.javapapers.android.mymap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.os.Handler.dispatchMessage(Handler.java:99)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.os.Looper.loop(Looper.java:130)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread.main(ActivityThread.java:3691)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at java.lang.reflect.Method.invokeNative(Native Method)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at java.lang.reflect.Method.invoke(Method.java:507)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at dalvik.system.NativeStart.main(Native Method)
    04-06 01:17:51.020: E/AndroidRuntime(29215): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:215)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.Activity.setContentView(Activity.java:1663)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at com.javapapers.android.mymap.MainActivity.onCreate(MainActivity.java:14)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
    04-06 01:17:51.020: E/AndroidRuntime(29215): … 11 more
    04-06 01:17:51.020: E/AndroidRuntime(29215): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.support.v4.app.Fragment.instantiate(Fragment.java:401)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
    04-06 01:17:51.020: E/AndroidRuntime(29215): … 19 more
    04-06 01:17:51.020: E/AndroidRuntime(29215): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SupportMapFragment in loader dalvik.system.PathClassLoader[/data/app/com.javapapers.android.mymap-2.apk]
    04-06 01:17:51.020: E/AndroidRuntime(29215): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    04-06 01:17:51.020: E/AndroidRuntime(29215): at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
    04-06 01:17:51.020: E/AndroidRuntime(29215): … 22 more
    04-06 01:17:58.485: I/Process(29215): Sending signal. PID: 29215 SIG: 9

  16. Nick Halden says:

    ohh sry..i guess its because i didnt modify my api key and fingerprints…

  17. Nick Halden says:

    hey joe..i finished the API key work..but still i m getting the same error in logcat as i posted before..

  18. Nick Halden says:

    .i added library project properly..latest logcat error.

    04-07 01:35:48.300: D/dalvikvm(15946): GC_EXTERNAL_ALLOC freed 60K, 49% free 2756K/5379K, external 0K/0K, paused 33ms
    04-07 01:35:48.315: D/dalvikvm(15946): DexOpt: couldn’t find field Landroid/content/res/Configuration;.smallestScreenWidthDp
    04-07 01:35:48.315: W/dalvikvm(15946): VFY: unable to resolve instance field 36
    04-07 01:35:48.315: D/dalvikvm(15946): VFY: replacing opcode 0×52 at 0×0012
    04-07 01:35:48.315: D/dalvikvm(15946): VFY: dead code 0×0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
    04-07 01:35:48.320: D/AndroidRuntime(15946): Shutting down VM
    04-07 01:35:48.320: W/dalvikvm(15946): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
    04-07 01:35:48.335: E/AndroidRuntime(15946): FATAL EXCEPTION: main
    04-07 01:35:48.335: E/AndroidRuntime(15946): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.javapapers.android.mymap/com.javapapers.android.mymap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.os.Handler.dispatchMessage(Handler.java:99)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.os.Looper.loop(Looper.java:130)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread.main(ActivityThread.java:3691)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at java.lang.reflect.Method.invokeNative(Native Method)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at java.lang.reflect.Method.invoke(Method.java:507)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at dalvik.system.NativeStart.main(Native Method)
    04-07 01:35:48.335: E/AndroidRuntime(15946): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:215)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.Activity.setContentView(Activity.java:1663)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.javapapers.android.mymap.MainActivity.onCreate(MainActivity.java:14)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
    04-07 01:35:48.335: E/AndroidRuntime(15946): … 11 more
    04-07 01:35:48.335: E/AndroidRuntime(15946): Caused by: java.lang.IllegalStateException: The meta-data tag in your app’s AndroidManifest.xml does not have the right value. Expected 4242000 but found 0. You must have the following declaration within the element:
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.internal.q.v(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.internal.q.u(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.SupportMapFragment$b.ex(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.dynamic.a.a(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
    04-07 01:35:48.335: E/AndroidRuntime(15946): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
    04-07 01:35:48.335: E/AndroidRuntime(15946): … 19 more
    04-07 01:35:58.070: I/Process(15946): Sending signal. PID: 15946 SIG: 9

  19. Anonymous says:

    Thank you for this article and given your time to make a good demo for Android Map.

  20. B says:

    Hi! I wasn’t able to run the apk. Please help!Here is my logcat:

    07-24 10:55:48.842: E/AndroidRuntime(26674): FATAL EXCEPTION: main
    07-24 10:55:48.842: E/AndroidRuntime(26674): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.javapapers.android.mymap/com.javapapers.android.mymap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread.access$600(ActivityThread.java:149)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.os.Handler.dispatchMessage(Handler.java:99)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.os.Looper.loop(Looper.java:153)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread.main(ActivityThread.java:5086)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at java.lang.reflect.Method.invokeNative(Native Method)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at java.lang.reflect.Method.invoke(Method.java:511)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at dalvik.system.NativeStart.main(Native Method)
    07-24 10:55:48.842: E/AndroidRuntime(26674): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:258)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.Activity.setContentView(Activity.java:1867)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.javapapers.android.mymap.MainActivity.onCreate(MainActivity.java:14)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.Activity.performCreate(Activity.java:5020)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
    07-24 10:55:48.842: E/AndroidRuntime(26674): … 11 more
    07-24 10:55:48.842: E/AndroidRuntime(26674): Caused by: java.lang.IllegalStateException: The meta-data tag in your app’s AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the element:
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.internal.q.v(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.internal.q.u(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.dynamic.a.a(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
    07-24 10:55:48.842: E/AndroidRuntime(26674): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
    07-24 10:55:48.842: E/AndroidRuntime(26674): … 20 more

Leave a Reply