添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Recently I published my new app, and this morning I decided to make a little changes to this app. However, every time I import any of my app folders on Eclipse, this error always showing up "Error generating final archive java.io.IOException: Invalid keystore format", even when I create a new Android file, this error keep showing up. Please, help me! I have created several apps and I don't want to create a new keystore.

Here is the Image of the error!

http://www.fileden.com/files/2006/5/5/14780/error.png

I already tried to clean the folder and restart but it didn't work.

Please help me, I would really appreciate it a lot thanks!

worked for me.. i opened (in mac).. /Users/myusername/ and deleted .android. .. and it started working smoothly. MFarooqi Jun 16, 2021 at 15:20

I had the same problem a while ago, when I changed the pass for the default.keystore

Check if the keystore that you are using as "debug.keystore" has the same pass as the default one. The following are the default:

Keystore name: "debug.keystore" Keystore password: "android" Key alias: "androiddebugkey" Key password: "android"

Android app signing

-storepasswd -v -new <new_storepass> -keystore <keystore full path> -storepass <storepass> this should be run from the bin folder of your installed java distribution Ciprian Radu May 17, 2011 at 19:48 usually the default path is C:\Users\YOUR_USER\.android\debug.keystore (this is on win7) Ciprian Radu May 17, 2011 at 19:53 try running this in the cmd window "C:\Program Files\Java\jre6\bin\"keytool.exe -storepasswd -v -new <new_storepass> -keystore <keystore full path> -storepass <current storepass> Ciprian Radu May 17, 2011 at 19:57

This solution is worked for me.

Delete "debug.keystore" file from ".android" folder and restart Android studio, studio will create a new file.

Go inside the ".android" folder and run rm debug.keystore.

Try deleting your trusted.certs file.

If the keystore has actually been corrupted, you won't be able to regenerate the same one and update your app... this is why it's very, very important to back up your keystore.

If the error pops up when you're importing a project rather than keysigning your app, though, I suspect it's a problem with Eclipse or your Java setup... not a problem with the keystore you created.

It looks from your screenshot that you're on Windows 7, so try around here (but with your username): <user>\application data\sun\java\deployment\security Turnsole May 18, 2011 at 0:24

It is due to different use of java versions

Like I have installed jdk_1.8 at D:\Program Files\Java\

And for android studio, It was using D:\Program Files\Android\Android Studio\jre

When I just used keytool I got error as invalid keytool format

but when I changed this cmd like below it worked for me!

"D:\Program Files\Android\Android Studio\jre\bin\keytool" -list -v -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
                This looks right for my situation.  My openJDK keytool.exe was major version 8, but the one in android studio was 11
– ArtHare
                Dec 1, 2022 at 17:38

I had the same issue as Shubham Jumar Gupta with JVM version mismatches.

The keystore that Android Studio generated was presumably generated with the in-app JDK 11.

The keytool.exe available on my PATH and my JAVA_HOME was JDK 8 (verified with trying to run it from cmd)

Eventually after a lot of messing around, I had to update Gradle's Java Home path buried in File->Settings->Build, Execution, Deployment->Build Tools->Gradle. Then I have to change the "Gradle JDK" to point to a newer version of the JDK. In my case, JDK 11 matched what came in Android Studio's built-in JRE and then I was able to build my release APK.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.