failed to decrypt safe contents entry: java.io.IOException: getSecretKey failed: Password is not ASCII
Asked Answered
P

5

14

This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to build this is what I get.

Digging back one error up in the output I see this:

Execution failed for task ':app:packageRelease'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable com.android.ide.common.signing.KeytoolException: Failed to read key key0 from store "C:\AndroidRelated\KeyStoreForCompanyA\KeyStore.jks": keystore password was incorrect

I have it remember my password from build to build though.

Note that if I change this manually to what I know is correct, then it will build. Just a bug in Android Studio Beta maybe or is this overridden somewhere other than the Generate Signed Bundle or SDK dialog?

Pralltriller answered 10/2, 2021 at 19:56 Comment(3)
I started seeing this error when I upgraded to AS 4.2. As you already said the only solution for now is to uncheck "remember my password" and enter it manually.Distal
@Distal Thanks bro, you saved my precious time. Google screws android IDE and Android OS with every update. Uncheck "remember my password" , entered it manually and it worked somehow.Karyotin
Issue is fixed. Check below link. issuetracker.google.com/issues/192538185Metamorphosis
C
29

Solved!

Step;

  1. Clean your project
  2. Generate signed yours bundle/.apk file
  3. Uncheck the "Remember password"
  4. Manually put your password at "Key store password" and "Key password"
  5. Click Next and you Done!.

Android studio update bring this bug.

Cosper answered 15/6, 2021 at 17:2 Comment(1)
would like to add , switch to Eng language, type with a single hand and probably finger ))Fin
W
12

It is a bug in Android Studio 4.2.+

You have to manually type password each time you generate signed APK!

Wilds answered 26/6, 2021 at 9:30 Comment(2)
any official reference for this or any bug opened against it?Butter
issuetracker.google.com/issues/191307563 @NoumanChWilds
T
3

I faced the same problem. Android Studio saves passwords in a bad format.

I solved it by typing the password manually again.

Turner answered 13/6, 2021 at 8:50 Comment(0)
B
2

Android Studio tries to use the ASCII which is generated as you give your passwords but as it tries to re generate it based on your system language and datetime it can differ in some charachters. So, in some special cases it is better to use your keyboard to type your password.

Generate Signed Bundle or APK

As you see it makes different passwords in each part. It works correctly in some cases also but totally in act of preventing the trouble it is better to retype manually.

Battik answered 25/7, 2021 at 7:34 Comment(0)
L
2

You can resolve it quickly by deleting the keystore file and create a new one from the Build -> Generate signed bundle/APK -> APK -> create new options.

enter image description here

Lapointe answered 6/9, 2021 at 17:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.