Pregunta

I have written a correct Google map code.Everything runs,but the map does not come. i have used correct sha 1 machine key to generate the API key which i have.I have used different emulators and mobile phones,but its not coming.what may be the probable reason? xml code:

¿Fue útil?

Solución

you have to given those permission in manifiest

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="api key"/>
// android.apikey

<meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

Please follow these steps:

  1. Update the google play services in the SDK.

  2. Manually uninstall the App from device and restart the device. i have tried it and its going perfectly bro

Also do one thing get the new api key to edited the new sh1 code from https://code.google.com/apis/console/

you can get your sh1 code from window- preference-android-buid

Otros consejos

I think your problem is that the API Key you are using is incorrect.

In Order to get a valid API_KEY:

1) Go to Google APIS (https://cloud.google.com/console) and create a new project

2) Go to Apis & auth --> APIS and select "Google Maps Android API v2"

3) Go to Apis & auth --> Credentials and Create new key (for API access) "Key for Android applications"

4) Copy/paste the "API key" value to your manifest (as described Ravind)

5) If it works, then try adding restriction of the packages that are allowed

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top