0

I'm having some problems when experimenting creating a Google Maps app on my laptop/HTC android phone. I've created a very simple sample program using examples on the internet and I've set up my phone in developer mode, and to allow USB debugging. I have an API key which is enabled, I've looked at the GOTCHAs! on this page Android: Google Maps Android API: Authorization failure

But when I try to debug and run it on my phone, I get a blank screen and in the debug window, I get:

E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
                       Ensure that the "Google Maps Android API v2" is enabled.
                       Ensure that the following Android Key exists:
                        API Key: ****
                        Android Application (<cert_fingerprint>;<package_name>): 82:D1:22:C3:3E:8E:02:9F:30:09:2C:2E:F7:15:13:90:C9:1F:32:F7;com.paullee.getest

Can anyone help please?

user3713442
  • 428
  • 5
  • 20
  • Do you have the Google Maps API enabled in the developer console? – Daniel Nugent May 12 '18 at 15:41
  • when I go to https://console.developers.google.com/ and select my project, then go to Libraries in the left hand side and then " Maps SDK for Android", it says that the API is enabled. – user3713442 May 12 '18 at 15:45
  • Double check the fingerprint and package name in the API key in the developer console. Make sure it matches up to what is in the logs you posted. – Daniel Nugent May 12 '18 at 16:32

2 Answers2

2
  1. Login to your Google Cloud Platform Console
  2. Click APIs at left panel
  3. Click Maps SDK for Android and Enable it
  4. Click Credentials and select your API Key
  5. Application restrictions: select Android apps
  6. Input cert_fingerprint and package_name

Done

Sudi
  • 21
  • 3
0

Map implementation needs api key from google developer console (also registering your system SHA1 if restrict api key).

You will do 2 things :

  1. Enable map api for your project
  2. Put your SHA1 fingerprint to developer console (if you use restricted api)

Some useful links for you getting api key and SHA1

https://stackoverflow.com/a/33479550/6891563

How to get google map apikey in android

Khemraj Sharma
  • 46,529
  • 18
  • 168
  • 182