title: keytool error: java.io.IOException: Invalid keystore format - Android
body: <p>I was following Step 3 from <a href="https://developers.google.com/nearby/messages/android/get-started" rel="nofollow noreferrer">https://developers.google.com/nearby/messages/android/get-started</a> but I entered the wrong keystore password and now I am getting a "Invalid keystore format". Please advise how to fix? Here's the full stacktrace:</p>
  
  <pre><code>mymacbook .android $ keytool -exportcert -alias \
  &gt; androiddebugkey -keystore \
  &gt; ~/.android/debug.keystore -list -v
  Enter keystore password:  
  keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
  java.io.IOException: Keystore was tampered with, or password was incorrect
      at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:780)
      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:889)
      at sun.security.tools.keytool.Main.run(Main.java:340)
      at sun.security.tools.keytool.Main.main(Main.java:333)
  Caused by: java.security.UnrecoverableKeyException: Password verification failed
      at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
      ... 7 more
  mymacbook .android $ keytool -exportcert -alias \
  &gt; &gt; androiddebugkey -keystore \
  &gt; &gt; ~/.android/debug.keystore -list -v
  mymacbook .android $ keytool -exportcert -alias \
  &gt; androiddebugkey -keystore \
  &gt; ~/.android/debug.keystore -list -v
  keytool error: java.io.IOException: Invalid keystore format
  java.io.IOException: Invalid keystore format
      at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:658)
      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:792)
      at sun.security.tools.keytool.Main.run(Main.java:340)
      at sun.security.tools.keytool.Main.main(Main.java:333)
  mymacbook .android $ 
  </code></pre>
  
  <p>And now whenever I type the following command I just keep getting the "invalid keystore format" error and it doesn't even ask me to enter password now:</p>
  
  <p>"keytool -exportcert -alias \
  androiddebugkey -keystore \
  ~/.android/debug.keystore -list -v"</p>