I am pulling out my remaining hair on this one. I can build app X with an old keystore, but I need to create a new keystore for a whole new set of projects I am working on. I’ve tried several times to create a new one and fail almost every time because I am trying to use a different password for key1 than I use for the keystore itself.
Test #1: I created the keystore with a password 123456 and key1 is protected with password 123456, but I did NOT check the box “use the same password.” When I build the same app X with everything the same except the new key, it builds fine.
Test #2: created the keystore with a password 123456 and key1 is protected with password abcdef, and I have NOT checked the box “use the same password.” When I build the same app X with everything the same except this new key, I get this:
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:packageRelease’.
A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
com.android.ide.common.signing.KeytoolException: Failed to read key key1 from store “C:\Users\postiffm\AppData\Local\Temp\App Builder\build\SAB.049\a\ks.jks”: Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
Test #3: created the keystore with a password 123456 and key1 is protected with the same password, but this time through the “use the same password” checkbox. When I build the same app X with everything the same except this new key, it builds fine.
My old original keystore that I have used for a long time does use different passwords for the keystore and key1, and it works fine.
The point: it APPEARS that new keystores created with a different password do not function correctly. Can you verify this? It makes me concerned that we could have faulty keys.