Reputation: 49
Got an error while run the command in terminal:
"keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore"
Results in below error:
java.io.IOException: Invalid keystore format
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:663)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
at java.security.KeyStore.load(KeyStore.java:1445)
at sun.security.tools.keytool.Main.doCommands(Main.java:941)
at sun.security.tools.keytool.Main.run(Main.java:379)
at sun.security.tools.keytool.Main.main(Main.java:372)
P.S: I have seen similar questions regarding this error, but none of the solutions solved my problem.
Upvotes: 1
Views: 3610
Reputation: 469
I have the same issues but later found that there is a different JDK version mentioned in android studio(JDK 11) and a different version installed in my system(JDK 8).
So after that, I installed JDK 11 in my system and then try the same which resolved the error. So the solution is the version should be the same on both sides which will fix the error.
Upvotes: 1
Reputation: 1
A simpler way would be to use Android Java, change "YOUR_USERNAME_HERE"
"c:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -list -v -keystore "C:\Users\YOUR_USERNAME_HERE\.android\debug.keystore"
Default password android
Upvotes: 0
Reputation: 49
Solved: After Running Flutter -v in android studioFound Out That:
Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) which indicated that there was difference with the java version installed (was currently using java 1.8).
I solved the problem by installing the same java version (In my case 11.0.12) and adding it to the PATH in environmental variables.
Upvotes: 3