Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javalang.exception:key pair not generated, alias <androiddebugkey> already exists and java.io.filenotfoundexception:debug.keystore

I enter the following

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

in cmd to generate debug keytool.

However, I received the error

java.io.filenotfoundexception:debug.keystore" instead. Afterwhich I changed the above command to "keytool -genkey -v -keystore C:\Users\me.android\debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

And this time I received another error

javalang.exception:key pair not generated, alias already exists

What goes wrong here? What I am trying to do here is just to generate a new debug keystore.

like image 660
Jason Chen Ming Avatar asked Aug 16 '17 16:08

Jason Chen Ming


1 Answers

Found out that you need to delete the existing debug.keystore before generating a new debug.keystore. When generating a new debug.keystore, you need to list the directory where you want to store the keystore file.

After delete the old debug keystore, enter the below command in android studio terminal:

keytool -genkey -v -keystore debug.keystore C:\Users\abc\.android\debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

Where debug.keystore is the name you want to define your keystore file, C:\Users\abc\.android\debug.keystore is the directory where you want to store the keystore

like image 165
Jason Chen Ming Avatar answered Oct 13 '22 12:10

Jason Chen Ming