This IP, site or mobile application is not authorized to use this API key - Android

I have a problem connecting to the Google Maps API V2 and Android. I turned on the services:

  • Google Android API for Android v2
  • API Places

I also added the sha1 fingerprint.

enter image description here

But I still get this message: This IP, site or mobile application is not allowed to use this API key

I'm calling an Android service. You know where the problem may be, because I don’t know where to look.

+7
android google-maps-android-api-2 google-places-api google-places
source share
7 answers

You must create a browser key, not an android key. I ran into a similar problem when I accidentally created an Android key for Google cloud messaging instead of a server key. Check which key is needed for your purpose. For google maps v2 you need a key for Android, and for google sites api you need a server key (I searched google, but I'm not so sure that this one never used it). So basically you need two keys.

Update: You need a server key for api sites.

+10
source share

Refer to this guide.

http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/

Step 1 Go to code.google.com/apis/console/?noredirect

Step 2 Create a new project

Step 3 Go to the services and select the "Place API", enable it. This will ask your organization name and URL. Fill them out and click "OK."

Step 4 Now go to the Access API and your API key will appear. You do not need to click the Create New Key button. This will be your application browser key, which you can use in your Android applications.

This solution worked great for me.

+6
source share

When creating an Android application, the Server IP address can be any IP address of any phone on any network. What do I write in the "Accept requests from these server IP addresses" field to accept any IP address?

Edit - Apologies. Apparently just leave the field blank ...

+2
source share

I had this problem the other day, in fact this is not a problem with this library.

First, make sure that you are using the server’s API key, not the Android / iOS key (if you are a mobile developer). See this stackoverflow post: Google Places API request forbidden for Android autocomplete, even with the correct api key . The TL, DR version of this link is that the Google Places API does not support the key for Android / iOS, only a server option.

Secondly, and it goes without saying, make sure you pass the key to an instance of GooglePlaces.

Finally, if you are restricting the use of the API key by IP, make sure your request comes from a valid address.

+2
source share

You do not need to create a key to use the Google place API, instead just use the β€œ Key for browser applications (with links) . But if you want to use the Google Maps API, you need to generate an Android key, and you can find the instruction here: https: //developers.google.com/maps/documentation/android/start .

Good luck.

0
source share

I have this problem too. but I solved this problem only with the help of something complicated. Go to the Google console and create a new key, which is the browser key, and then let it blank and save the column. Now you can use the key that was created in your mobile applications. GOOD LUCK! * Sorry, I can not send an image to this answer

0
source share

Change your API key, you can use the Android key in the URL. To specify the key in the URL, you need to get the WEBSERVICE key.

-2
source share

All Articles