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?
Solved!
Step;
Android studio update bring this bug.
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.
It is a bug in Android Studio 4.2.+
You have to manually type password each time you generate signed APK!
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With