In React Native when I'm trying to get Google GPS API key in Google console, I have seen package name and SHA-1 key where to I get SHA-1 key in React Native
How to get SHA-1 key in React Native cli? (not in Expo).
Click on Tasks. Click on android. Double Click on signingReport. Wait for few seconds and you will get SHA1 and MD5 in Console Bar.
SHA-1 Keys SHA-1 also referred to as the Secure Hash Algorithm. It is a cryptographic hash function that will take input and it produces a 160-bit hash value. This generated hash value is known as a message digest. This generated hash value is then rendered in a hexadecimal format number which is 40 digits long.
Windows:
– Open a terminal window
– Change the directory to the JDK bin directory. The path of the JDK depends upon the operating system you are using
cd C:\Program Files\Java\jdk1.8.0_121\bin
– Now we have to run the following command using the keytool.exe file in JDK/bin
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Ubuntu/Mac
– Open a terminal window
– Now run the following command
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For more details click Here
From React-native Project:
– Run this command in React-Native App directory
cd android && ./gradlew signingReport
– copy the SHA1 from the debug key (This generates two variant keys. You can copy the 'SHA1' that belongs to the debugAndroidTest variant key option.)
if your are Using react native
and using
keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android
there are Chances getting ERROR
to Avoid ERROR in WINDOWS
1)Run your Command Prompt As Administrator
3)cd android
4)type in ./gradlew signingReport
this will generate All kinds of SHA-1 And SHA-256 and many more details
There is debug.keystore available by default in android => app folder so we can use it to generate SHA1 key.
The command is as follows
keytool -exportcert -keystore ./android/app/debug.keystore -list -v
It will ask for password so just press Enter.
As far as I understand you, it's about Android.
You need input certificate fingerprint, what you use for sign *.apk file.
For generate SHA-1 fingerprint, open a terminal window and enter the following:
keytool -list -v -keystore PATH_TO_YOUR_KEYSTORE.keystore -alias YOUR_ALIAS_NAME -storepass YOUR_STORE_PASS -keypass YOUR_KEY_PASS
This should look something like this:
BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75
You can find more information here
If you don't have a certificate yet, I recommend you create it.
How to create a certificate you can read here.
Get SHA1 Key
Simple run below command :
keytool -list -v -keystore ./android/App/debug.keystore -alias androiddebugkey -storepass android -keypass android
Even though running keytool on jdk/bin and ./gradlew signingReport
command gives SHA-1 & SHA-256 keys I had troubles when using those keys on firebase / gcp to register my app. For some reason running keytool command on project root folder output gives you a SHA-1 key which can be use to register the app in gcp. In windows, there are the steps you should follow
keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android
And there is your SHA-1
my solution: keytool -J-Duser.language=en -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
first move to android folder cd android and than simply run .\gradlew signingReport command this help me on windows operating system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With