문제

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:

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top