Reputation: 139
I developed an Android app which contains Map Activity. Before publishing the application and now the map works properly in the emulator, but the map in the app published in google play does not appear. there is no problem in the position of the device or in the locations where I search, also calculates the distance between the location of the device and the location where I search but the map is completely grayed out. How can I solve this problem?
Upvotes: 6
Views: 3495
Reputation: 999
I face the issue for the google map, In debug app and release apk before publish on the Google play store Google Map works fine. After publish app in Open testing or production it fails to load.
For this issue there are two possible solution
Solution 1 - Generate restricted release key for the android app, which already explained in above solutions
Solution 2 - In case of above solution not work, then please check the Google Claud platform (GCP) has activated the billing account.
Once you add the billing account it will work. Happy Coding ;)
Upvotes: 1
Reputation: 327
More than 2 days I try to find the answer.
Finally, I found it. What I did was go to App signing
under Release management
on your google play console
There will be two SHA-1 certificate fingerprint
Then, go to your Google cloud console under Map API Key.
Put both fingerprints that you obtain from App signing
Voila!!!! a map is rendered :)
Upvotes: 21
Reputation: 1322
Seems like your API key for google maps is restricted.
For Android apps, you restrict the key to your app's package name and SHA-1 signing-certificate fingerprint.
You can see key restrictions in Google developer console Check the package name of local builds and published one. Then SHA1 of release and debug certificate. You can download release apk from Google Play console and get SHA1 of cert as described here.
Upvotes: 3