google maps doesnt show after upload to google play - android

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.

Related

Android google maps not working after publish

I have a google map in my app, but it is not working when I create a release signed app.
I tried everything what I've found here, with no luck.
I obtained the SHA1 fingerprint .\keytool -list -keystore C:\Users...signature.jks
It showed me the SHA1 fingerprint 98:EC:9D...
So in Google console under Maps SDK for Android I added my packagename and this fingerprint. I took the API key from there and put it in my app, into google_maps_api.xml, and in my Manifest I have this:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
I tested this with attached device and the debugger says:
Authorization failure.
E/Google Maps Android API: Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: AIzaSyD........
Android Application (<cert_fingerprint>;<package_name>): B7:06:CC:...;mypackage
So the map is not working, neither when I build the signed app.
As you can see, there is a total different fingerprint in the log, not sure from where.
Ok, so then I put that fingerprint (B7:06:CC...) to my Google console, and then the maps are working on my attached device without errors, BUT the map is not working when I create a signed APK!
Am I doing something wrong?
Ah, I finally found out! There are 2 different google_maps_api.xml files. One is in debug/res/values folder and the 2nd in release/res/values folder and that one in release folder had no API entered!
So one is used when debugging and the other for release.
So now it is working fine.

Google Maps V2 not working in production with correct key

I'm having major troubles getting Google Maps working in production within an Android app. This is what I am currently getting (the bottom is just ads).
Key Steps I have followed:
1) I have ensured I have got the correct SHA1 Production Key and have implemented it on the Google Console API as well as within the app (They key that google gives). I have registered two keys - one for the debug and one for production
2) Internet, location, etc is working
3) The app works in DEBUG mode, but does not work when signed and installed on device via USB. I have triple checked the SHA 1 signature of the sign, etc.
4) The MapsFragment comes from the template available in Android Studio.
In production mode, the log cat displays this:
01-11 16:04:54.511 19346-19437/com.mike.mapstest E/Google Maps Android API﹕ Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
01-11 16:04:54.516 19346-19437/com.mike.mapstest 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 (<cert_fingerprint>;<package_name>): <SHA1 Removed for this> ;com.mike.mapstest
This error obviously says something is wrong with my auth?
What am I doing wrong?
Based on the logcat output from your debuggable release build:
01-11 16:04:54.511 19346-19437/com.mike.mapstest E/Google Maps Android API﹕ Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
01-11 16:04:54.516 19346-19437/com.mike.mapstest 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 (<cert_fingerprint>;<package_name>): <SHA1 Removed for this> ;com.mike.mapstest
it would appear that you have not overridden the api key placeholder YOUR_KEY_HERE in the manifest (or separate api keys file, depending on your configuration). Replace that string, wherever it lives, with your actual key and you should be good to go.
Edit: this tutorial, if it matches your configuration, probably explains why you are only seeing this for release builds:
Return to Android Studio and paste the API key into the YOUR_KEY_HERE section of the file:
Note that these steps have enabled Google Maps support for the debug version of the application package. The API key will also need to be added to the google_maps_api.xml file located in MapDemo -> app -> src -> release -> res -> values when the release version of the application is ready to be built.
I was having these same issues, and was banging my head against the wall for a few days. I read all the posts about putting the correct key in place. I kept putting the correct key in my google_maps_api.xml file. StKent above mentioned to make sure to overwrite with the actual string in AndroidManifest.xml. This is what fixed it for me.
What I had when it didn't work:
in AndroidManifest.xml:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
and in google_maps_api.xml:
<string name="google_maps_key"
templateMergeStrategy="preserve"
translatable="false">AIza_the actual key</string>
What I changed to for it to work
I changed my AndroidManifest.xml to include:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzsa_the actual key" />
When using Android Studio to generate the Google Maps Activity, it will ignore your gradle build configs and use the default debug.keystore. The SHA1 in google_maps_api.xml is based off of this default. When creating permission in the Google API console, make sure to use your production and debug SHA1 if you are using the non default.
debug and production key will be different . If you use debug key for release mode ,you can not view the google map. For release mode , when you change google map key , you should clean the project then export apk.
you can get more information
https://developers.google.com/maps/documentation/android/start
to get private SHA1 from debug key store
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass your_app_password
to see more
SHA-1 fingerprint of keystore certificate
or you can you eclipse tool to generate private SHA1 key using export menu
In my case, I had entered the wrong package name in Google API's API Manager - Credentials - "Restrict usage to your Android apps". Make sure you enter the correct package name (as in AndroidManifest.xml) and the correct SHA fingerprints (for debug and production).
Solved, I put on the Manifest the "Key for browser apps (with referers)" instead of the "Key for Android apps (with certificates)" from the Google API Console
In my case, the gray screen was caused by having a custom implementation of HostnameVerifier that was preventing the tiles from being loaded.
Hope this will help someone else in the future.
error //Ensure that the "Google Maps Android API v2" is enabled.
In this u can't find like Google Maps Android API v2 in Google Cloud Platform Console.in this, give the exact Package Name: and signature of your project which is showing in run window or debug window , I faced the same problem because of changing MapActivity package location
I struggled to find this whole day so make sure whether u changed any packages inside project if so give package which is showing in error text
emphasized text
Ensure that the following Android Key exists:
API Key: YOUR_KEY_HERE
Android Application (;): ;com.mike.mapstest

Android Google Maps API V2 not showing map when published

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.

Google Maps Android API keystore

In my app, I use maps to show the current position. Then, I use Google Maps Android API v2 (I don’t use Google Maps API) to add this functionality to my app.
When I am developing my app in eclipse everything is OK. I create an Android key with the debug keystore and I use it in the manifest, I can execute my app well and I can move and use the map. In this case I have no log errors (only the typical “The Google Play services resources were not found. Check your project configuration to ensure that the resources are included”).
Now when I upload my app to the Google Play Developer Console, in beta testing it works, but when I go publish, the map gets grey background and doesn’t work. Log gives me this error:
09-23 14:05:46.475: E/Google Maps Android API(5485): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:05:46.475: E/Google Maps Android API(5485): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************RDEI, Certificate Fingerprint: 472D********************************7218 (keystore use to sign the package)
Then I decide to use in my eclipse project that keystore, so I create a new Android key (47:2D:*************************:72:18;gc.yy.xxxx gives me AIza*****************Qm4Q key) and I paste it in the manifest file. I run the project and I get once again the grey background. Log gives me this error:
09-23 14:10:45.307: E/Google Maps Android API(5585): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:10:45.317: E/Google Maps Android API(5585): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************Qm4Q, Certificate Fingerprint: CC4B********************************A917 (debug keystore)
I don’t know if the problems concerns to the keystore. I use debug.keystore with my map (I can’t use another one, I don’t know if it’s not possible) and I use a keystore I create to sign my app package. It seems an infinite loop of no useful API keys…
Thanks in advance!
EDIT: I finally solved it by adding the 2 meta-data blocks of each API key, that is to say, my manifest was like this:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIza*******************************RDEI" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIza*******************************Qm4Q" />
And finally, I have my app in Google Play! :)
You need to register your non-debug keystore to the google maps API via the Google API console
I used two different api keys (one for development, one for the release). At the end: that's stupid, since you can have several app hashes attached to one key. Hence that's the solution, just added on code.google.com/apis/console the release hash to the development api key (for backwards compatibility) and the development hash to the release api key (for easier development).

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.

Categories

Resources