I've create key for android application , and set the debug sha1 from key store debug which android studio should use.
I extract the sha1 using this command :
keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android
I double check that I set correctly the key and the package name at the google developer. and also delete the key and generate another one, but that doesn't help, google maps deosn't appear.
please notice that my production app work perfect.
What may be the problem ?
EDIT:
logcat show this:
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
SOLVED:
I forget to enable the map api at the google project console, the log cat doesn't doesn't show this problem.
When I had this issue, it was because the package name I entered in the developer console to get the key was different from the package name of my application. Please ensure that they are the same
Related
Am using Google Sheet API in my Android App. It's working fine as expected in debug mode. Stopped working when I published it in the play store. Now App is getting crashed due to it. Users seem unhappy now!
Make sure that you update the SHA-1 with the release SHA-1 in the Key restriction section at the Google developer console.
Steps:
Open the Google Console.
Select your project.
Select credentials.
Select your key.
You see the picture below explaining where to edit the SHA-1.
You can get the "Release certificate fingerprint" from the following command.
keytool -list -v -keystore your_keystore_name -alias your_alias_name
I am developing an app which requires google maps on android. Earlier I was developing on Windows and everything was working perfectly. A few days ago I switched to ubuntu and the maps suddenly stopped working. I have added the sha1 key to the console -
API key:
AIzaSyDD3ntjHTCKntDoVJt7J_eMZs-t7lYIlZ8
Android apps:
98:26:30:05:AF:D7:74:3F:5F:C1:BF:D6:24:80:5E:9B:DC:F4:F4:D6;com.opaxlabs.boatbrat EB:53:F8:2A:B3:05:63:5E:3F:CF:17:47:63:A8:8B:FA:C8:67:30:D4;com.opaxlabs.boatbrat
Activated on: Jun 25, 2014 5:07 AM
So that I have two sha1 fingerprints. I switched back to windows to check and the app was working perfectly there. The error in log cat states that -
Google Maps Android API(10773): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
The build when run on devices shows a blank screen where there should be a map.
The api key is mentioned in the manifest as -
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDD3ntjHTCKntDoVJt7J_eMZs-t7lYIlZ8" />
Also in the emulator it asks me to update the api showing me a button to update which when clicked crashes the app. Please help me with your suggestions. Thanks in advance.
Edit:
The problem seems to be in the fact(Although I am not sure about it) that I had created a demo project on the google console and put the sha1 in it. Later I created a project and put a sha1 in that too. It seems that it was taking the key from the demo project and not the proper project. I have deleted the contents of the demo project but to no avail. Is there a way to correct this problem?
Open terminal
navigate to /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin (bin of java )
write On terminal :- keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android
4.copy the SHA1 key and paste in place of the previous SHA1 of your windows
dont change anything else.
its working......
Seems like an issue with the api key.
Generate sha1 of the debug certificate on your ubuntu, and add it to the api console as another key in addition to the sha1 of certificate from windows.
That should solve the problem.
Regenerate sha on your pc,
Go to google console,
Create new Android key (for google map),(delete the old)
For Linux:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Copy sha with name of your project , for example: (Sha;projectname)
98:26:30:05:AF:D7:74:3F:5F:C1:BF:D6:24:80:5E:9B:DC:F4:F4:D6;com.example.androidapp
Copy API key to app.
In google console your Android apps have 2 times sha and project name.
I've tried V1 and V3, and both of them got me the same result: no map , no error , just grid.
I'm sure that I put the key.
Is the problem in the version. Should I use V3?
I don't find clear tutorials for V3 like V2 & V1. (Videos are the simplest way)
If V2 is still working, what do u think is the problem?
You should be using V2. and Your api key is most likely the culprit for this issue.
I've seen it multiple times. Verify your api key is included correctly and is the right api key to use with your app.
The easiest way to get started using Google Maps API v2 is to generate a debug key using the debug keystore. On Windows the debug keystore is called debug.keystore and should be located in the following directory:
C:\Users\your_user_name\.android
Once you locate the debug keystore get the SHA1 by entering the following command in the command prompt:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Use this SHA1 to generate your API key and you should be able to finally see the map.
More detailed information about creating a debug and release API key can be found here.
I'm stuck in this issue, when i run my project in eclipse it shows map correct, but when i upload it to Google play store and when i install it in my device , it shows the blank map,
I don't know what is a problem my map key is correct, package name is correct, i also generate new map key and try, but it also doesn't work. I don't know where is the issue.
Please follow the check-list :
1) Sign the app with new .keystore.
2) SHA1 of new .keystore should be used.
3) Map key should be made using this SHA1.
4) If new Google account is used, then make sure Android Maps V2 services is turned on for that account.
As this type of issue was already raised and there was the solutions
Google Map Android API v2 can't display map in play store application
This problem is because of map api key.
You need to sign your app and find keystore for signed app.
Right click on project
Android Tools->Export Signed application pachage->next -> create new keystore
then use this new keysore to find new SHA1
Now find new API key for your app.
And replace the old map API key with this in manifest.
Next time whenever you want new signed app just use this keystore no need to create new again.
Make sure you update the SHA-1 in the play store from the location
Select your App --> App Integrity --> App signing key certificate --> SHA-1 certificate fingerprint.
Paste it into Release Key along with the app package name.
You need to do the following things to get your Maps Visible for both Debug Mode and release mode
-1 Add debug key to package combination at Google API console
-2 Add release key to page combination at Google API Console
Note : you need to add at lease 2 combination to get your maps visible when you are testing and when you generate *.apk file.
What you are missing right now is not adding the release key to application package combination to API console add this and after that do the following:
replace your debug map key with release key and generate your *.apk and install aplication to your device you will get your maps
there are several Tutorial available on net i would to suggest you the following one
Google Maps
To Generate the Release key do the following steps
Open CMD (in Windows) terminal (in Linux?MAC os) find the path to your jdk dir and then to bin like following:
C:\path-to-jdk\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore path-to-keystore -storepass password -keypass passowrd
for me the path is following for Jdk/bin and that for key store
C:\Program Files\Java\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore D:\ke
yStore -storepass password -keypass password
you need to give the following things of your own
-1 path to jdk
-2 path to keystore
-3 keystore passoword
-4 keypass password
Also look http://android-er.blogspot.in/2012/12/displaying-sha1-certificate-fingerprint.html for more information
I am using Google Maps V1 API key. If i Itaking the apk from bin folder, the Google Maps will shown in application. But if I export the project and deploy the exorted apk the google maps do not show in the application. If anybody knows the reason, kindly share your thoughts. Thank you.
When you develop and run an application locally, you are actually signing it with a debug key.
When you export, you are signing it with a different, production key.
Google Maps requires your api key to match the key you sign your app with. So you will need 2 different api keys depending on whether your apk was made via debug key (copying it from "bin") or production (exporting).
What's happening to you is when you export your app, the key is not matching what Google Maps API thinks it should be, so it's not working.
Read more about signing apps here.
Please follow these steps to get Release SHA1
Find your .jks path which is used while creating signed apk.
Ex: /Users/dharm/Documents/Android/test.jks
Copy your jks file name and put in the end of line number 3
Ex: test.jks
Open your terminal and enter this command keytool -list -v -keystore "keystorepath" -alias "keyalias"
Ex: keytool -list -v -keystore /Users/dharm/Documents/Android/test.jks -alias test
When you will press enter it will ask for Enter keystore password. So please enter your key store password.
If you do all the steps successfully then you will get entire information of this certificate(key store).
Ex:
MD5: D2:52:A1:7C:14:9F:D5:DD:64:35:E2:3F:74:CA:C5:E7
SHA1: D3:32:AA:09:81:71:50:D2:47:20:43:B2:13:A2:D5:55:4B:A7:DC:3C
SHA256:
27:8A:84:C5:C3:CE:98:47:A7:73:E2:87:91:5E:5A:A2:F4:B8:D4:D4:0E
Now you can put this SHA1 key on google console( SHA-1 certificate fingerprint).
Hope it will help you.
For Video Kindly have a look on it
https://www.youtube.com/watch?v=g75cZXjmuj8&feature=youtu.be
I put the key directly in the manifest and began to work.