I was working with google map. In debug mode, it was fantastic. For release mode I tried to get the release SHA1 key from my windows10 hp probook. But i got some encrypted text instead of SHA1.
My command is as follows:
C:\Program Files\Java\jdk1.8.0_45\bin>keytool -exportcert -alias razon** -keystore E:\keystore\keystore.jks
The output was as follows along with some unknown signs that are unable to write here:
0S10 U8810dhaka10Udhaka10U
410608143654Z0S10 U8810dhaka10Udhaka10U
Then I created another API key for google map from Developer console with a SHA1, used previously in another project. With this API, the map is working in release mode but only in my device(Nexus 5, os6.1).
My Questions
How can I get the actual SHA1?
What can I do now? Please help.
You can use the keytool -list -v command (documentation):
keytool -list -v -alias razon** -keystore E:\keystore\keystore.jks
More easiest way:
Double click on the signingReport. You will see your debug and release SHA1 fingerprint. But before that you must have to set the keystore file from Project structure.
In order to do that, go to File>Project Structures...>app>Sigining>+
After that give a name and locate the store file(keystore or .jks) and provide your alias and password.
Then Click OK.
Then again go to File>Project Structures...>app>Build Types and there you will see debug and release. Select each of them and change the Sigining Config value to you newly created one.
Related
I'm following this tutorial to create a Turn Based Multiplayer game: https://developers.google.com/games/services/console/enabling
Under the Specify client ID settings section, they say to run:
keytool -list -keystore [path-to-debug-keystore]
That's fine because they also mention the location of the debug keystore: "On Windows, the debug keystore can be found at C:\Users[USERNAME].android\debug.keystore."
They also say to run this command:
keytool -list -keystore [path-to-production-keystore]
But they don't mention where the release/production keystore is.
...where is it?
You generate the production key yourself. Read Sign Your App in the android developer documentation.
I am trying to implement AppInvites. I have gone through all steps written here https://firebase.google.com/docs/invites/android
And constantly get RESULT_CODE = 3, what have I done wrong?
Just to be sure it's not your code, you can download Firebase's quickstart samples from here: https://github.com/firebase/quickstart-android. Make sure to update the app-level gradle file with the right package name.
The guide you followed is a little incomplete, and doesn't explicitly mention the need to provide your app's SHA1 key when setting up your project in the Firebase console. Here's how to add the SHA1 key for a release certificate and a debug certificate to an existing Firebase project:
How to find the SHA1 for your keystore:
In command prompt, navigate to your Java installation. You'll be using Java's built-in keystore utility.
For the release certificate, type the following:
keytool -exportcert -list -v -alias <your-key-name> -keystore <path-to-production-keystore>
Note the SHA1 key it provides.
For the debug certificate, type the following:
keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
Again, note the SHA1 key it provides. Since this key is unique to each Android development environment, feel free to repeat this step for each environment you want to build from.
Once your have your SHA1 keys, enter them both into your Firebase project:
Go to your Firebase console.
Click on the three overflow dots on the project in question and click "Manage".
Click SHA1 and enter your first key.
Click SHA1 again and enter your second key.
From there, you just need to download the new google-services.json file and add it to your project's /app directory.
No map shows up but a grid. So I looked up some sample fixes and came to this
help needed to publish android app in market
however, after running the cmds as suggested, I end up with a SHA1 certificate fingerprint. But when I go to sign up for a google API key, I see I need an MD5 certificate fingerprint instead. How do I tackle this please?
And here is the solution to your problem
Open Command Prompt and navigate to C:\Program Files\Java\jre6\bin(might be different in your case).
As you are following this solution that means you have keystore with you.If yes move to step 3. else create a new keystore like mentioned in this.
Type the following command keytool.exe -v -list -keystore " <path_of_keystore_youhave_created_in_step_2>" it will ask for password use the same password you have used while creating keystore and you will get SHA1 MD5 and many information you have provided while creating keystore.
First find the location of debug.keystore (In eclipse you can find location of debug.keystore at Window->Preference->Android->Build).Then navigate the path of keytool.exe in command prompt. keytool.exe is located inside Java –> JDK – > bin folder inside program files.
For window write the following code in command prompt C:\Program Files\Java\jdk1.6.0_25\bin> keytool -list –alias androiddebugkey -keystore <path_of_debug.keystore> -storepass android -keypass android
Here <path_of_debug.keystore> is path of debug.keystore. For my case it is C:\Users\virus.android.
Copy the MD5 key(eg:- BE:05:C8:F2:42:7A:97:37:78:EE:BD:4A:31:7D:A6:69) and goto on following link to find google map api key http://code.google.com/android/maps-api-signup.html
I want to use googleAPI. I have tried the following:
1)I have generated a googleAPI key using the keytool and the debug.keystore.
2) I have also generated another key using Myactivity.keystore.
Following these instructions, from fere and other sits:
You'll have to do following things to get it working:
You'll have to generate a MD5 hash of your application debug key
You'll have to provide that MD5 hash to Google while signing up for a map key
Google will then give you a key that you can put in your mapview
This is going to work in these steps:
Locate the android debug key in your system. it is found on the following locations depending on your operating system (This path will be useful):
Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore
Mac OS X and Linux : ~/.android/debug.keystore (where ~ is the path of your home directory.
In a terminal, use the following keytool command to generate the MD5 Hash:
keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore -storepass android -keypass android
Copy the generated hash
Go to : code.google. com/android/maps-api-signup.html (you maybe required to login with your Google account)
Paste the above generated MD5 hash there, accept the Terms and Conditions and click on Generate button
You'll get the API key for your map. paste this in your
When you plan to release the app, generate a release key and repeat the same procedure with the release keys.
Although, all the above steps are exactly what the links contain, but this is a summary.
I have tried them both but non of them seems to work. I see only the grid ant in the logcat i get Couldn't get connection factory client and through all the search I have done this is a problem with my api key. how should I know that my api key is correct?
Try This to get Correct API key:--
That is the exact path--
keytool -list -keystore "C:\Users\XYZ\.android\debug.keystore"
Total path for cmd prompt to get the MD5 fingureprint for the GoogleMap API Key***
D:\eclipse\jre\bin>keytool -list -keystore "C:\Users\XYZ\.android\debug.keystore"
MD5 fingurePrint will look like this--
3E:F4:D6:E6:93:4D:BB:B8:62:3A:A6:0F:E0:FC:4C:65
When u get the fingurePrint number afterthat to get the API Key use this link---
http://code.google.com/android/add-ons/google-apis/maps-api-signup.html
Then u will get API key of your system and can get the Map easily....
Now I am working on the Google maps API. I am not able to display the map on the emulator as well as the device......... how can i dis play the map.
I tried like this but i failed...
I searched for the debug.keystore in c:/ i found it.
I got Keytool.exe from the "C:\Program Files\Java\<JDK_version_number>\bin".
Opened the commend prompt and went to the above folder.
After that i copied this
"keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android"
and pressed enter then I got the Google api key **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
I pasted the key in this site http://code.google.com/android/maps-api-signup.html.
but the map is not generated it is saying that
fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint.
What i need to do now to get the Map API key.
Okay, I was able to solve the problem in my case. I've got Java 7 on my machine and when I followed all the instructions as they are, I've got a SHA1 fingerprint, not MD5. I tried to use it to get the key and received exactly the error message from which this thread has started.
If you are having the same problem, just add the -v option (verbose output) after -list. keytool will then give you the MD5 fingerprint as well - use it.
keytool -list -v -alias androiddebugkey -keystore C:\Users\<user>\.android\debug.keystore -storepass android -keypass android
I will try to let Android folks know that they need to update the page with instructions.
for JDK 1.7 you get SHA1 fingerprint by default. But for generating Google Map API key you need fingerprint of MD5.
For more details navigate through the below link.
How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
Ok, so what you're supposed to enter in the link you posted is the MD5 fingerprint of your android SDK debug certificate. To get this you navigate here
Windows Vista: C:\Users\.android\debug.keystore
Windows XP: C:\Documents and Settings\.android\debug.keystore
and then enter
keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android
What you're currently doing is navigating to your Java folder and trying to find the fingerprint for your android SDK debug certificate there. It isn't located in that folder and hence you end up with a blank fingerprint ::*:::*:::*:::*:::*:*
You need to find the .android folder.
have you checked the path you use? I mean "C:\android\debug.keystore", Does the file there?
have you compared your fingerprint (the result of keytool.exe calling) with the example on http://code.google.com/android/maps-api-signup.html page? they must be very similar, maybe you just copied not the whole fingerprint from the cmd
Here is the simplest way to generate MD5 signature.
Find the folder .android which contains debug,keystore(usually it is located in c:\Documents and Settings\"User Name".android
Oepn command prompt and go to the keytool folder that you mentioned.
Now use following easy command to key MD5 fingerprint.
keytool -list -keystore "c:\Documents and Settings\"User Name".android\debug.keystore"
press Enter. It will ask you for password again press enter.
Enter the generated key in Google API registration page.
Use this key in your MapView.
I too had the same problem but got fixed...the problem might be you.. might have not given default location for emulator..i will get u the proper way to get the map in emulator...
1)to generate the hash key
http://code.google.com/android/add-ons/google-apis/mapkey.html
2)to set the default location
http://www.vogella.de/articles/AndroidLocationAPI/article.html#device_installation
hope it works fine..