7

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!

Kev
  • 118,037
  • 53
  • 300
  • 385
user739375
  • 219
  • 3
  • 4
  • 13

8 Answers8

10

Delete .android folder in your work space then try with step by step process.

Also, be careful while creating key stores and passwords and alias.

Petr R.
  • 1,247
  • 2
  • 22
  • 30
  • worked for me.. i opened (in mac).. /Users/myusername/ and deleted .android. .. and it started working smoothly. – MFarooqi Jun 16 '21 at 15:20
7

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

Ciprian Radu
  • 788
  • 7
  • 16
4

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.

3

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
  • 1
    This looks right for my situation. My openJDK keytool.exe was major version 8, but the one in android studio was 11 – ArtHare Dec 01 '22 at 17:38
2

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.

Turnsole
  • 3,422
  • 5
  • 30
  • 52
  • It looks from your screenshot that you're on Windows 7, so try around here (but with your username): \application data\sun\java\deployment\security – Turnsole May 18 '11 at 00:24
  • Is it my imagination, or did this question get mangled with another one? – Turnsole May 18 '11 at 16:11
1

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.

ArtHare
  • 1,798
  • 20
  • 22
0

Go to the folder, delete debug.keystore and restart Eclipse.

C:\Users\INTEL\.android
Onik
  • 19,396
  • 14
  • 68
  • 91
Ragupathy
  • 149
  • 3
0

Am using below version, i just did clean then build for the project and worked.

clean project

build project

android studio version

shareef
  • 9,255
  • 13
  • 58
  • 89