0

I am really stuck on this issue while generating a signed apk in android studio v2020.3.1 patch 2:

I created a key store path as it was my first time, I added the path, alias, key store password and key password but after the creation when I used it, I got an error while generating the signed apk:

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable com.android.ide.common.signing.KeytoolException: Failed to read key passvault from store "D:\Softwares\Key Paths\Apps.jks": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

Any suggestions appreciated, because i have no idea what goes wrong.

Exitron
  • 17
  • 12

1 Answers1

0

You have setup to sign your APK on build. The corresponding key store (first password) and the key (second password) are encrypted. Your build can't encrypt the key. The passwords are not stored in your project configuration by default, you have to reenter them after you have closed the project once.

Fix after opening the project:

  1. Menu -> Build -> Generate Signed Bundle / APK ...
  2. Follow the steps to enter the password for the key store and the key you want to use.
  3. Build should work until you close the project.

If you have entered the wrong password, you have to repeat the steps above.

See also answers here with screenshots attached: Generate signed apk android studio

Fa11enAngel
  • 4,690
  • 2
  • 39
  • 38