0

I'm trying to display the google map for an android project. I followed all the steps without any problems, but when i launch my application, the map simply doesn't show up, i just have a white screen.

This is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.map"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <permission
        android:name="com.map.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.map.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <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" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
          <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="MyKeyXXXXXXX" />
        <activity
            android:name="com.map.HomeActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@style/FullscreenTheme" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>



        <activity
            android:name="com.map.MapActivity"
            android:label="@string/title_activity_map" >

        </activity>
    </application>

</manifest>

Does anyone see something wrong ? thanks in advance

nicopico
  • 3,606
  • 1
  • 28
  • 30

2 Answers2

1

Here are the steps you should follow:

  • Grab the Google Play services SDK (It's where the Maps API is)
  • Get the API key
  • Set the key in the Application Manifest

Last but not least, don't forget that Google Maps will only show if your app is signed with the key you provided to get the Maps key. For example, if you've used a production certificate and you're testing the app with the debug key, you won't be able to see the maps.

0

I had this problem too. Your API key is not the giant series of two characters. On the Google Maps API console, after you have created your project and enabled Google Maps, you need to go to the API Access page, and click on "Create a new Android Key" if you don't have one already.

Your API Key that you use in your app is the ~40 character string that appears on the new key. Paste that into the Manifest and it should work.

Yos233
  • 2,396
  • 2
  • 15
  • 15