Android Studio cannot create the keystore for a signed APK or bundle
Generate Signed Bundle or APK > Create new > the New Key Store dialog does not create the fileShort answer
The New Key Store dialog builds a keystore with keytool rules behind it. Two things break it most: a password shorter than six characters, and a key store path that has no file name ending in .jks. Fill both correctly, or create the keystore with keytool and select it.
Fix it fast
1Find out which cause you have
Create the keystore with keytool in a terminal. If keytool works, the problem is in the dialog fields; if it also fails, its message names the cause.
keytool -genkeypair -keystore upload-keystore.jks -alias upload -keyalg RSA -validity 100002Match what you see, then jump to its fix
What does the error look like?
Generate Signed Bundle or APK > Create new > the New Key Store dialog does not create the fileNo .jks file appears at the chosen location
Cause 1 of 2
A password is shorter than six characters
1Check
The keytool manual states that store and key passwords must contain at least six characters.
keytool -help2Fix
Use a keystore password and key password of six characters or more. Android's signing guide asks for a strong password for each and says the key password should match the keystore password.
keytool -genkeypair -keystore upload-keystore.jks -alias upload -keyalg RSA -validity 100003Verify
The command prompts for passwords, asks for certificate details and writes the file.
keytool -list -keystore upload-keystore.jksConfirmed by docs.oracle.com
Cause 2 of 2
The key store path has no file name or no .jks extension
1Check
Look at the field in the New Key Store dialog.
ls -l /path/to/folder2Fix
Choose the folder, then add a file name with the .jks extension at the end of the path, for example upload-keystore.jks.
/Users/me/keys/upload-keystore.jks3Verify
After OK, the file exists on disk.
ls -l /Users/me/keys/upload-keystore.jksConfirmed by developer.android.com
How do I stop it coming back?
- Create the keystore once, back it up somewhere safe, and keep its passwords out of the project repository.
- Pick a validity of at least 25 years when you first create the key, as Android's guide recommends.
- Name the file with .jks and keep the key password equal to the keystore password.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile apps
adb tcpip 5555 fails because no device is found
adb: more than one device/emulator
adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.
4 causes, each with a fixMobile apps
The Android Emulator says /dev/kvm is not found
KVM acceleration can NOT be used
The emulator wants a hypervisor and cannot find one.
4 causes, each with a fixMobile apps
The emulator says the GPU driver is unsupported and falls back to software
vulkan-1.dll cannot be found
The emulator picks a graphics mode when it starts.
4 causes, each with a fix