Hj. I am using google map API v2 for project. In my office, it works fine with cert_fingerprint key 1
But when doing it in home, i got a blank google map. Trace log i can see this:
03-17 04:40:44.288 12461-12510/com.dump.dms 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: AIzaSyDEE3COcEWPZte_cpPl*********L2Cm_A
Android Application ( < cert_fingerprint > ;< package_name >): EF:FA:C1:36:BD:FA:D6:6A:DE: ** : ** : ** :53:C8:8B:16:C1:15:C7:ED;com.dump.dms (call cert_fingerprint key 2)
So i must to replace to cert_fingerprint key 2 . Then my app works normally.
Could anyone explain why i need 2 cert_fingerprint key like that? How can i use only one cert_fingerprint key ?
When deploying your app as debug build, the problem is that at home your debug.keystore is different than at work. In your office, you used that debug.keystore to generate the SHA1 key which you used for generating the Google Maps API Key. When you deploy your app at home now, another debug.keystore is used and the key doesn't match.
The easiest way would be to copy your the debug.keystore file from your work environment and use it at home. But you can also enter multiple SHA1 keys in your Google API console like this (for every environment you use which means you need to create SHA1 keys for the debug.keystore files of all your environments):
AB:0A:05:...:12;com.example
CD:35:01:...:2B;com.example
The same problem appears when you deploy as release build (using the keystore file you need to generate when exporting your Android App as APK file)
See also: http://developer.android.com/tools/publishing/app-signing.html#debug-mode
Related
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.
Developing an Android app locally using Android Studio 1.3
Small closed beta on Google Play Store One API key registered against this one app with two SHA1 keys - one local, and one for the release-signed APK using our organisation's Android keystore
Google Maps works locally while connected to the PC via Android Studio
Google Maps fails when downloaded via the Play store produces a blank grey map with Google logo with this error in logs
5967-6038/? 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>):
23:C9:76:CA:A6:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:91:9B:80:3F;org.bto.btapp
SHA1 keys registered against developer console:
Output from keytool (debug local)
Output from keytool (release keystore used to sign APK on Play store beta)
Have checked the obvious (am I using the correct API key)
Any ideas?
Check whether you have copy pasted your API key in google_maps_api.xml in values folder. From the error log(i'm assuming), your API key is shown as "YOUR_KEY_HERE", that's exactly the default value in the file. Please check.
UPDATE
Open the google_maps_api.xml and paste your api key at "YOUR_KEY_HERE". That will do it.
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
Google maps v2 is implemented in my app. It works fine when it is run with other computer.
But it is not showing Map when Apk is generated with my computer.
Is there any settings to change in my PC?. Please suggest me.
Google maps API key is generated with Signed key.
You are absolutely right you do not need to change the api key it is unique.
So you don't need to change anything in manifest.xml.
But, As you said when you run the project from your computer it does not showing the map. Because when you run the project by default it sign the apk with debug.keystore.
So now what you have to do is, just generate the SHA-1 from your pc using debug.keystore and make entry of that SHA-1 in google api console.
You can add multiple SHA-1 in your project settings at google api console.
Just see the screenshot you will got the idea.
when you run form your computer then debug.keystore used and when you create apk then keystore is change and also SH1 key is changed so your map is not show when you create apk.
Solution: create new api key for apk, use this key when you create apk. this link help you to get SH1 key from keystore
My com.me.ProjectA is a working app that uses Google Maps V2. I have both Release and Dubug api keys for this app that I got at the Google API console. The app works perfectly.
I copied projectA renaming it to com.me.ProjectB. I tested ProjectB on my device and everything ran fine except, as expected, the map would not show because I still had the api keys for the old namespace of ProjectA in the manifest file.
So, I went to the Google API console and got a new debug api key for com.me.ProjectB using my SHA1 debug fingerprint (That I can get in Eclipse by hitting Windows->Prefs->Android-> build) and my com.me.ProjectB namespace and put this into my manifest file.
So, I think I am doing everything right but when I run it on the device I get no map and I get the messages in logcat saying...
12-14 16:32:34.389: E/Google Maps Android API(30070): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
12-14 16:32:34.399: E/Google Maps Android API(30070): Ensure that the following correspond to what is in the API Console: Package Name: com.me.ProjectB, API Key: AIzaSyAk1dcariCofa7b4pboMGVtReWaDwT_yL4, Certificate Fingerprint: 5A608D32E8A0901CCCD2C519010AD73BE5F609A2 (these are not the real values)
And, of course, the namespace, SHA1 fingerprint, and the API key all match.
Did I forget to do something?
Thanks,
Gary
Have you tried to completely remove the application and then install it all over again. As you said you tried to run the project with the key from Project A. This key might be got cached and even if you install the application with the new key, the old one will be used.
So before you install your application with the new key, try to remove the application completely from the phone.
You can as well go over this blog post I wrote and make sure you do all the steps right in producing the key:
Google Maps API V2 Key