I have shifted myself from Eclipse to Android Studio. Now I am trying to work on my Map app. So I need my SHA-1 fingerprint certificate number.
When I was using Eclipse it was right under Windows -> Preferences -> Android -> Build. But in Android Studio I couldn't find out any option like this so that I could find easily the fingerprint. I am using Windows. I have read from this link that:
Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE.
So I tried to run this in command line after setting my Java bin path from this link and unfortunately couldn't find my fingerprint. It is saying that it is an illegal option.
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Is there a way to find the SHA-1 fingerprint from Android Studio like it was very easy in Eclipse? As I am newbie in Android Studio, what is the full process to find it?
Another thing I want to add is that I have my Eclipse generates the SHA-1 fingerprint and previously I have my app registered on that fingerprint in Google developer console, and I worked on that app in Eclipse by that API key. Is the same API key can be worked on this my project in Android Studio?
If you are using Android Studio, you can get the SHA-1 and MD5 certificate fingerprint (debug, release... all Build Types!!) fast through Gradle Tasks:
The SHA-1 and MD5 certificates are shown in Messages Logs.
Android Plugin (configured in the Gradle app) creates a debug mode for default.
File route to keystore:
I recommend to attach
debug.keystore
tobuild.gradle
. To do this put a file,debug.keystore
, in an app folder and then Add SigningConfigs in Gradle app:Extra: If you want creates for release, put a file,
release.keystore
, in an app folder. (This example uses the samedebug.keystore
.)The easiest way to get the finger print is to switch from app to signed report by clicking the drop down and click build.
Then you will be able to see the sha1 fingerprint at the bottom pane where you see the debug report and stack trace. N.B remember to switch back to app when you want to run your app on a device or an emulator.
I just found the case to get SHA-1 in Android Studio:
And you will see all you need to get
google_maps_key
.For Mac, this worked perfectly:
This worked in my case: Use %USERPROFILE% instead of giving path .keystore file stored in this path automatically C:Users/user name/.android:
It's work only for debug mode. In realease mode I can not see sha-1. Here result of
gradlew signingReport
So I must use keytool to get sha-1. Here official Firebase doc:
Get_sha-1_for_release