"Cannot load keystore" error in Android Studio 3 only when generating signed APK

Viewed 705

I am having an incredibly strange error. I have just updated to Android Studio 3, and now whenever I try to Generate Signed APK, I am told:

"Cannot load keystore: Keystore was tampered with, or password was incorrect"

With Android Studio 2, this keystore was working perfectly.

Here's the strangest thing:

When I 'Run' my app (Shift + F10) using my release build and stored keystore credentials, it signs and runs fine. When I check my keystore credentials using http://keystore-explorer.org/ they are also all correct.

So what's happening here? Is this a bug with Android Studio 3? How can I make a new signed APK?

1 Answers

The problem was that my password contained special characters, which Android Studio 'escaped' for me, without my realising. So when I copy-pasted the saved password to sign my APK, it was full of misplaced '\'s.

Related