Problem with the Google Maps API key

0

Map does not open on the actual device using% generated%.

I made .apk for Map using the AS wizard for this purpose, in this way it generates a Activity . I was in the Google API where I already have an account and a project and then I generated a key that I put in my project and everything working correctly!

With the project finished, I generated a Key Store , I got the SH1 generated a new key, returned to the Google API, removed the% I put the new one. I asked to generate a new key however, I saw that nothing has changed or the key was the same!

I generated SH1 and the map does not appear!

I stopped doing something that should? Did I skip any steps?

    
asked by anonymous 20.12.2016 / 16:16

2 answers

2

To first create credentials to access your enabled APIs, see the details in the API documentation . Secondly, I'll give you some tips below:

Create API Key

Step 1: Fingerprint for certification SHA-1

To get the fingerprint for SHA-1 certification, you have to log in to the console of your computer and carry out the following command:

  

keytool -list -v -keystore c   : \ Users \ MyNameUser \ .android \ debug.keystore -alias androiddebugkey -storepass android -keypass android

FORMAT: 5D:C1:0B:2E:E2:91:C3:BB:3E:60:6A:8A:3E:8D:56:C1:0A:C6:36:B2

Step 2: Create your API key

To create your API key, visit the Console APIs at link and sign in with your Google account.

FORMAT: AIzaSyAi6j8jukil9XnoWzeAsB1Fgr1CQkq9Yk8

Look at the image below as it should be configured correctly.

Image:

CreateOAuth2.0ClientIDs

YouhavetogenerateaAuthorizationcertificatefingerprint

AddyourpackagenameandfingerprintoftheloginSHA-1certificatetorestrictusagetoyourAndroidapplications. See here .

Note below how it should be configured:

Image:

Despiteallsetup,it'simportanttodownloadthe%% provided by Google Console and save in of the APP folder in your project.

No Manifest.xml

In your application, you should enter your google-services.json 's as follows:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="@string/google_maps_key" />

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

PS: No forget to grant permission to access internet meta-data

    
20.12.2016 / 19:21
0

In production, if you use Google Play App Signing, you can easily find SHA-1 at:

link > Click on your > Version Management > App Subscription > Signing certificate for the app

Also follow the procedure also by @Viana so that you can use api in debug mode (by the emulator for example)

    
14.09.2018 / 14:32