Faizan Ahmad
Faizan Ahmad

Reputation: 362

Google Map API is not working on release mode

I am using Google Map in my android. It was working fine. Today I implemented Google Places API, after that when I build release APK, map is not working. I don't know that it is because of Google Places API or because of something else. I cross verified SHA1 key, keystore file. I am unable to find the issue. I am using these dependencies:

implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation "com.google.android.gms:play-services-gcm:17.0.0"

On opening map, it is showing blank map.

I am facing it only on release (signed) apk, not on debug apk. Screenshot is: enter image description here

Upvotes: 1

Views: 1172

Answers (3)

Muhammad khaled
Muhammad khaled

Reputation: 374

if you have restricted your maps api key with SHA1

check if your put release SHA1 not debug one

Upvotes: 0

Moumen Hamada
Moumen Hamada

Reputation: 51

You should make sure that you set your release API key.

src/release/res/values/google_maps_api.xml

Since android generates two different xml files for google maps. One for debug and One for release. You probably have your API key placed on debug only.

Upvotes: 1

Nipuna Jayawardana
Nipuna Jayawardana

Reputation: 557

did you add the google maps api key to the manifest?

Upvotes: 0

Related Questions