Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android Studio cannot create the keystore for a signed APK or bundle

ErrorGenerate Signed Bundle or APK > Create new > the New Key Store dialog does not create the file

Short 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.

  • Applies to Android Studio current stable, JDK 21 keytool, Windows 11, macOS 26, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 10000
  2. 2Match what you see, then jump to its fix

    1. 1The keystore is not created and one of the passwords you typed has fewer than six characters.A password is shorter than six charactersFix
    2. 2The Key store path field points at a folder, not at a file.The key store path has no file name or no .jks extensionFix

What does the error look like?

  • Generate Signed Bundle or APK > Create new > the New Key Store dialog does not create the file
  • No .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 -help

2Fix

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 10000

3Verify

The command prompts for passwords, asks for certificate details and writes the file.

keytool -list -keystore upload-keystore.jks

Confirmed by docs.oracle.com

Did this fix it?

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/folder

2Fix

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.jks

3Verify

After OK, the file exists on disk.

ls -l /Users/me/keys/upload-keystore.jks

Confirmed by developer.android.com

Did this fix it?

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 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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.