Android Google Maps API V2 not showing map when published - android

Just ran into a problem, when testing on device while in development - maps worked fine.
After I published it to beta stage I downloaded it from Google Play Store and ran the app, but map showed up grey and didn't work.
What am I doing wrong?
my api key is specified in manifest like:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY_HERE" />

Okay, got it fixed.
When I exported and signed the apk for publishing it gave me SHA1 and MD5 keys.
I just copied SHA1 key and went to Google API's and edited allowed Android Devices.
There I added new line so the new Android Devices looked like:
debug.key.sha1;package.app
just.generated.sha1;package.app
didn't even need to reupload new APK, it just worked straight away.
Also this helped:
http://smdaudhilbe.wordpress.com/tag/google-maps-v2-not-displaying-after-app-published-in-google-play/

The key is bound to the apk signing - I am pretty sure this is your problem there

When you publish an app that uses Google Maps API and your map in the released version is blank or gray then do the following...
find your keystore (*.jks file) (you needed to generate this in order to publish anyway)
execute something like this in command prompt (Windows)
"C:\Program Files\Java... whatever java version you have ...\jre\bin\keytool.exe" -list -v -keystore
myappkeystore.jks
You'll see a bunch of info including your release APK's SHA1 if done right.
Go here:
https://code.google.com/apis/console
Opt out of the new interface (its horrible) and use the old interface if possible
In old interface go to services and make sure Google Maps is enabled
Now go to API Access and update your old SHA1 with the new one by click "Edit Allowed Android Apps" to the right and overwrite the old one with the new one. Click Update. Done.

When we deploy on Play Store, Google generates a new SHA1 hash for the version published. To solve this issue, it is necessary to open the application's console on the Play Store and take the new SHA1 in Version Management -> App Subscription. Finally, you can use this SHA1 in Google Maps API Console to generate your Maps key.

Related

google map not show in release apk using android studio

I am developing an app, here I'm using google map in debug mode map shows correctly but in release mode map not showing and shows only current location.
By using google map API I have tried but still its not working and also I find the SHA1 by using keystore(i.e. keytool -list -v -keystore file path.jks) then also its not working.
By using following views I tried and found the SHA1 key but map not shown in app.
Release APK file not showing google maps
How do i do?
Have you set your google_maps_key in both debug & release folder in google_maps_api.xml.
If not please, set it. You can find both folders inside Project structure.
See image for reference.
Generate API key access using release key-store. And set Google API console.
Go to google API console.
crate new project
generage API key
enable your service
add API key in your project
OR
You can simply follow this developer guide LINK.
If you have troubling in getting SHA-1 key. You can easily get it by running Signing-report gradle task as below picture (in Android studio).
I solved it by looking at Google Play Console in the left menu select configuration, then integrity of the app and then copy the sha1 of the upload key certificate that is below of the SHA1 Certificate of the app signing key and add it in the same API key of Google Cloud Platform. This way I didn't have to make changes to the apk.
If it doesn't work for you, add both and try.

google maps doesnt show after upload to google play

I uploaded my app to the google play store, and the map didn't work, just showed white screen. I understand that I have to get a key based on the release certificate fingerprint. I have tried to read all about it, and have done the following, but it still isn't working:
I created a new keystore (with password, and alias and password etc) from Android Studio.
I run the cmd and did this:
keytool -list -v -keystore key.jls -alias MyPlaces
then put in my password, and got all the information that I need. I generated a key for google maps and places api, based on the sha1 fingerprint result that I got. I put in my package name. I put the Alias code back into my app for the key.
But it still doesn't work. I know others have had this problem, but what helped for them hasn't helped me.
Why? I hope its clear what i wrote. Thanks
I am not uploading it each time i check to the play store. Rather i create the signed apk, then try to run it from my phone. DOes this matter?
EDITED:
This is the message I get in the logs.
06-22 23:10:07.529 6500-6543/? E/b: Authentication failed on the server.
06-22 23:10:07.530 6500-6543/? E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
06-22 23:10:07.536 6500-6543/? E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: YOUR_KEY_HERE
Android Application (;): 38:.......F0;com.....myplaces (I have deleted this for security)
i solved this problem finally after 3 week :D
you upload the googleplay your apk, now you have 2 different " SHA-1 ", They are
"Installation certificate (your old certificate code)" and "Application signing certificate(its the new, from the googleplay")
you need to do so easy, you must add to api console your new SHA-1
First check if you have debug and release app keys. Then you have to link your api to your proyect. Apis and services (google play console). So You have to configure google play services because google maps api uses it.
I know there are diferent keys for debug and released apps. i recomend
API v3 too.
Try this to register your api key.
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo
It can take some minutes. Then you have to set your google_maps_key in
your android app Manifiest.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSDSSDDDAAD...Your API KEY" />
If doesnt work and if you are using android studio, try creating a new
Map Activity(It's V3), complete res/values/google_maps_api.xml with
the key and the map gonna work. How to create google map
I can use googlemaps in my app after upload it to google play store. You have to configure Google Play Services in your google play console.
Consider trying this approach:
First, I see you have done some of the steps as described in the developer documentation.
You should however, add a second key for the debug to the project you created on the developer console.
For some reason, without both, sometimes it fails to show the map when you publish.
I also switched from using v2 to geo when adding to your AndroidManifest file.
Of course you must add the INTERNET PERMISSION and if you are using Gradle dependency manager, add the google-play-services from your sdk.
compile 'com.google.android.gms:play-services-maps:9.0.2'
I hope this helps! Let me know how it goes!
This is the answer.
In my log it showed:
API Key: YOUR_KEY_HERE
Google automatically makes a resource file, googles_maps_api.xml and in there the string reference:
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIza....DOWdQ</string>
When compiled, it wan't identifying this string. I made a string resource in the strings.xml file, and then it worked.

Google Maps not displaying when using the sample

I have loaded up the SimpleMapDemo from the Google Play Services sample. I have retrieved a Google API Key, yet the map does not display when deploying the app to the emulator. There is no internal errors yet the map is not displaying.
I have generated a logcat output file to try and find the problem, yet I am not sure what to exactly look for.
May I please have some help to figure out what is wrong? Here is the logcat output file: http://canninginc.co.nz/logcat/logfile.txt
Thanks in advance.
Remember that you need a debug key certificate to get your api key, i mean, you dont have to use your real key certificate.
make sure your JRE folder is in your PATH
open CMS and go to C:\Users[USER NAME].android
run keytool -list -v -keystore debug.keystore -storepass android -keypass android
copy the Certificate fingerprint SHA1
go to https://code.google.com/apis/console/ and create your api key with this fingerprint
Also, check out the version of your emulator. Remember that Play services only work on SDK version 4.2.2 or higher.
http://developer.android.com/google/play-services/setup.html
Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services.
also, there are some tricks around to make it work in previous versions, i guess you already tried since google gives a lot of useful results
create your new google maps API Key and replace this key in AndroidManifest

Google maps v2 android api key working only with debug key

I have a problem with Google Maps api v2 on my android app.
I have generated the key for the debug certificate and everything works fine, but I can't make it work with the release certificate.
I've generated the key and the alias with eclipse, then I took the SHA1 which eclipse shows at the end of the "Export signed application" process.
Then I generated the api key for android apps in my google api console using
SHA1;package name
But it doesn't work... it works only with the debug key generated in the same way, only using the sha1 of the debug certificate!
Please help me, otherwise I can't release my app
Check your manifest file, I guess you've forgotten to set your release map api key there while exporting with your release key?
Me too faced the same problem during releasing my app to google Play, when I used Google Maps V2 in my app. After succeeding the issue, I wrote a blog post regarding this you can have a look.
As everyone requested, I would say the answer in following steps
1) Sign up your app using eclipse adt
2) Note down the SHA1 finger print which will be displayed at console of your eclipse adt
3) Again go to google console and get API_KEY for your app by using above got SHA1 fingerprint
4) Replace the old API_KEY with the new API_KEY on to manifest.xml of your app
5) Again sign up your app. Your app is ready to be published. But keep in mind that once you published your app to google market, you should be able to release updates to your app by signing .apk using the keystore which you used earlier for release.
Hope this helps ...
There are two files google maps api.xml, one is the debug and release the other, then you should replace the key generated on google website console and enter this file, another outlet is inserted directly into the manifest.

Android Maps API2 release key working locally but not through Play Store

I am making an app that uses the Google Maps API V2. When building the App in debug mode, using the debug key the map gets displayed fine. The same is true, when I export the app using Eclipses export function and my production key, installing the app locally with:
adb install com.package.name
However when I publish the apk in the Play Store (as an alpha test) and download it on my device, no map is displayed, making me suspect that something goes wrong with the key.
I registered the production key in the API console and changed the maps key in the manifest to the new key, hence it works when I install it through ADB.
I also uninstalled the app, before the reinstallation from the Play Store and removed my debug key from the API console, to make sure that the release key gets used (and thereby is working correctly).
Any help would be greatly appreciated.
This is a late response, but I thought it might help others who might run into this similar problem. I too had all my release/debug keys generated correctly and the maps on my signed release apk works well through ADB install, but not after uploading to Google Play Store.
Here is my solution: With the new optional "Google Play App Signing" feature, your final SHA1 can be found in your Google Play Console -> Release Management -> App Signing. Add the SHA1 for the app signing certificate to your key restriction list for the API in your API console and your map should be working.
Apparently the generated SHA1 using my own keystore (release) prior to uploading, is different from the final one, after uploading into Google Play Store.
Hope this helps.
Go to the google Apis console and add one more entry with your debug key.
So then you will have an entry :
45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:-- blah blah production key;com.package.name
45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:--yada yada debug key;com.package.name
//The keys I used are random you will get them both running the following command for each keystore ( debug and production )
Use this command to get the key :
keytool -list -v -keystore mystore.keystore
tl;dr two keys one for debug one for production and two entries to the Google Api Console
I fixed the problem by creating a new app and a new certificate. I don't consider this a "solution" since I did not find out what went wrong in the first place.
Basically whenever in the case of Google Map, we need an API key, which is generated on the basis of SH1 key of keystore.
When you work on local system, then we have to use the SH1 key which is displayed in Eclipse. But when we sign our application to make an APK to upload on playstore, we need to edit the exiting key and replace the old SH1 key with a newer SH1 key.
Note: You can get the newer SH1, while signing the APK for playstore. While signing it display the SH1 key of of keystore file, which you are using for that particular application for Playstore.

Categories

Resources