Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio. Building signed APK. Get Key Failed

I've been building release versions of my app for months, and now all of a sudden I get this error.
Failed to read key ******** from store ***** Get Key Failed. Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
This is beyond frustrating.

What I've done so far

  1. Read every post on this error and tried every solution
  2. Verified my passwords are correct
  3. Checked and unchecked "save passwords"
  4. Verified my keystore location is correct
like image 857
seekingStillness Avatar asked Dec 18 '22 11:12

seekingStillness


2 Answers

If you get error like block not properly padded, bad key or PKCS12 when signing the App Bundle or APK, try using the same password for the key and the keystore file, it works for me.

like image 156
Sam Chen Avatar answered Dec 21 '22 11:12

Sam Chen


Recently, Android Studio started to show a message: "Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. in Android Studio" - so, first of all, store and key passwords should be the same, like other people said.

Besides, after getting this error even using the same password, I realized that we can't use characters like @ or $ on the passwords.

like image 30
Fernando Ghisi Avatar answered Dec 21 '22 10:12

Fernando Ghisi