0

I'm currently busy building a ionic app. I am busy with facebook login and for me to register my app on the facebook developers dashboard i need to give info on the app.

One of them are that i need to generate a hash key. to do that i need to run the following command from within my java/bin

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

then i get this error when i do that

keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\Reyno.android\debug.keystore

this basically means the file isnt there right.

So my question is how can i generate a new one without installing android studio. I know it wil generate a new one if i install android studio.

ref: Where is debug.keystore in Android Studio

Thanks in advance

MohammedAli
  • 2,361
  • 2
  • 19
  • 36

1 Answers1

0

I found a solution to this question after a bit of futher investigation. It's quite simple.

(1)Open your cmd as administrator (2)navigate to your keytool directory. Mine was located at "C:\Program Files\Java\jdk-" 13.0.1\bin\keytool" (3)enter the following command

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA - keysize 2048 -validity 10000

(4)answer the questions they ask, i'll list them below

Enter keystore password Reenter keystore password What is your first and last name? What is the name of your organizational unit? What is the name of your organization? What is the name of your city? What is the name of your state or province? What is the two-letter country code for this unit?

They wil then just ask you to confirm if the details are correct, you can just type "Y" for yes. If you use "N" for no they wil ask you to complete the questions again.

(5)Go to your java jdk directory, in my case it was C:\Program Files\Java\jdk-13.0.1\bin\ Then search for a file called "my-release-key.keystore"

Please copy it and save it in a safe place you wil need to use it everytime you publish or update your app.

Hope this helps someone