This question already has answers here:
Published App on Play Store can't communicate with Google Maps API and Facebook API
(6 answers)
Closed 5 years ago.
As mentioned in the title, the Maps Activity shows blank (with Google logo underneath) after I've uploaded the application. I am aware this question has been asked many times but none of the solution is able to resolve my issue.
This is what I've done so far:
Generated Google Maps Release API Key (with SHA-1 signature) following the official guide here and placed it under the release/res/values/google_maps_api.xml
Place the Release API Key hardcoded into the AndroidManifest.xml
Clean and rebuild the project
This is the result:
The Maps Activity just worked perfectly fine if the app-release.apk is installed manually to the device before upload to the Play Store.
The Maps Activity shows blank if the app-release.apk after the app-release.apk is uploaded to the Play Store.
Solution:
This answer solved the issue I am facing. The reason the Maps activity shows blank previously because Google Play re-signs the app with the original app signing key I've provided. So just copy the Google SHA-1 and paste it to the console where the Google Map API Key is generated.
If GMap activity is added in any project then there are two google_maps_api.xml. One is for Debug and One is for Release.
Probably you've entered the key in Debug only as when we add Gmap activity, only google_maps_api.xml opens. So put your key in Release also. How?...see.
Click on TODO on the Bottom bar of Android Studio.
Click on scope Based tab of TODO.
Now there are two google_maps_api.XML, open each and copy your key
to XML with no key (YOUR_KEY_HERE).
This also happened with me.
You have missed adding the permission, try checking by including the permission.
<uses-permission android:name="android.permission.INTERNET" />
Related
I have published an app on Google Play but map is blank and I cannot figure out how to find the resulting api key that I need and where to put it. I have my SHA1 fingerprint and my api key that is for debugging.
Works great on my device but not after publishing. Every video and post I see on this is from years ago and doesn't seem to work. I can't figure out what I'm doing wrong.
Go to your Google play console where select the app and in left side : Release management=> App Signing=> copy SHA-1 certificate inside App signing certificatemodule and paste into the Google cloud console and add this SHA1 with your project and save it . it will work . it works me.
Hola,
I am trying to get the maps to work, it appears to work fine the the Nexus 6 emulator, however when I run it on a Moto G or a Samsung Galaxy the map is completely bank - it just contains the google logo in the bottom corner.
I have generated a google maps key and put that in my google_maps_api.xml file. Do I have to generate a SHA-1 certificate fingerprint?
If yes, how do I do this?
See answer: https://stackoverflow.com/a/33691443/5387193
I don't quite understand the instructions.
Here is my log:
http://textuploader.com/52xzy
Edit 1:
Added line to AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
It is now working on my Moto G but not on my Samsung. I think because I haven't accepted the sensitive information permission (ACCESS_FINE_LOCATION).
This app I am working on does not need to know the GPS location of the user, so I don't really need this sensitive information - is there an easy way to remove this function and permission?
I think the permission is causing the problems.
Edit 2:
I have got the code:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
in my AndroidManifest.xml, the #string/google_maps_key is a correct key that I have generated. I have generated a SHA1 fingerprint to get the key, do I need to put the fingerprint in my code somewhere?
I haven't generated a release key, I think it is just a debug key. Do you think this might be the issue?
I will setup google play services and see how that affects it.
Edit #3:
Uninstalled and reinstalled Google Play Services on Samsung and now it is working.
This line in your logcat seems to be the problems:
02-23 10:02:01.591 5760-5760/com.companyperth.companytools E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
It looks like Google Play services is not properly setup. You need to get google-services.json and put it into your project. To set up Google Play Services correctly, see Google APIs for Android.
You need to generate SHA1 fingerprint in order to get the Android key if you are using Google Maps for Android. See Get API key - Google Maps for Android. However, if you are using the Google Maps Javascript API(integrated into Android) you will not need to generate SHA1 fingerprint as you will be using Server Key.
Try to update your google map. I think that is the issue.
I am doing some modification in an existing apk that i got from my client to modify. I have decompiled application using apktool, changed some resources (like some strings from strings.xml) and recompiled/built it again using same tool. Then I signed using one_click_signer tool that I found somewhere of the google.
But when I install it on my device then google maps does not work anymore as it was working with original apk on the same device.
I have searched a lot about this but did not got any solution.
I reviewed this link and many more and come to conclusion that I need to sign the apk with same key that was in original apk.
So can anyone please tell me:
how can I sign the apk again with the same key and make map work?
or is there any other way to make maps work properly?
Solution That I found and worked for me:
Thanx for
#apmartin1991's answer . .
I created a google api console project and got got the generated key.
then I replaced that key in android-manifest.xml file and resigned the application.
It worked.
You will need to contact your client to get the .keystore file so you can sign it with the same key OR you can sign it with your own key and allow your key to be used with google maps, You can do this from the Google API console.
However if your clients app is on the appstore and you want to update that you MUST use the same key or it will be impossible to update it.
You need .keystore file to use the same key. If you dont have .keystore file you need to generate a new one and register a new key in google maps console.
You have all the official instructions here.
I am adding Google Maps into my application for the first time.
I have gone through several tutorials for getting the Google Maps API key for deployment.
But every where the first step indicated is to create a debug.KeyStore OR the create our own application keyStore
Then copy our SHA1 and paste it with the package name while generating API Key.
My small doubt is:
I am giving an Update of my application and added Google Maps in my version 2.
I do have the keyStore of my application that is already live on the play store.
So what do i do now as I already have my key and have to use the same key for the Update.
I dont want to mess up things at the time of deployment.
Please Help.
You must be use that keystore file which is already within the application on Google Play Store. Because if you create new keystore file then you have to regenerate process again.
So you have to go to with your old one keystore file.
You should be using the keystore that you already have. Basically you have no other option.
I have a problem about google map.
I did an app about include google maps.When i run the app with
Eclipse ,map is seeming everything is ok.
I signed the app and upload Android Market. When i dowload this app
for check i see the map blank.
I changed map key but it doesnt work?
Anybody know about that?
Have you changed the key of the google map component before sign? you must have a key for debug and another for published application.