Google Maps API Key in release build doesn't work

后端 未结 5 790
南方客
南方客 2020-12-30 09:36

I\'m currently developing an application for Android and I\'m using Google Maps API. In developer console, I added my SHA1 certificate print, followed by my package name. Ev

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 10:17

    Android Studio also creates a TODO in the release folder for the google_maps_api xml file and lets you know of the required procedure before release. Also please do not change the key in manifest manually. When you switch to a release variant, the key is automatically updated in the manifest.

    In any case do this,

    1. Go to the link as mentioned by @Andrew Brook

    2. Click "Get a key" and continue

    3. Either create a new project or use an existing one
    4. Specify the options and click the button
    5. If you already had made one before, for let's say for debug, then go to Create a new api key Image here
    6. Add the required name, click on "Add package name and fingerprint"
    7. Add your app's package name and SHA-1 key (generete it using keytool in java/jdk../bin/) Image here
    8. You get your "release" variant API key to be added in the google_maps_api.xml in the release folder.

提交回复
热议问题