Maaz Zindani

Loading the index…

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

Android build cannot find the keystore file for signing

ErrorKeystore file 'keystore.jks' not found for signing config 'externalOverride'

Short answer

The build was told to sign with a keystore file and no file exists at that path. Either the path typed in the Generate Signed Bundle or APK dialog is wrong, or storeFile in build.gradle resolves somewhere else than you think. Browse to the real file in the dialog, or make storeFile point at it from the module folder.

  • Applies to Android Studio current stable, Android Gradle Plugin 8.x, Gradle 8.x and 9.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check whether the file exists where the error says, then look for it on disk. If it is not found anywhere, the keystore was never created or was moved, and the third cause applies.

    find ~ -name "*.jks" -o -name "*.keystore" 2>/dev/null | head
    grep -rn "storeFile" app/build.gradle* ../keystore.properties 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1You started the build from Build > Generate Signed Bundle / APKThe key store path in the signing dialog is wrong or the file was movedFix
    2. 2The build runs from the command line or CI, or the path lives in build.gradlestoreFile in build.gradle is resolved from the wrong folderFix
    3. 3The build fails while loading keystore.properties, or storeFile resolves to a path that does not existThe path comes from keystore.properties and that file is missing or wrongFix

What does the error look like?

  • Keystore file 'keystore.jks' not found for signing config 'externalOverride'
  • Keystore file not found for signing config 'release'

Cause 1 of 3

The key store path in the signing dialog is wrong or the file was moved

1Check

The dialog asks for the Key store path, the key alias and both passwords. If the file moved since the last run, or the path was typed by hand, the file is not there.

ls -l /path/shown/in/the/dialog/keystore.jks

2Fix

Open Build > Generate Signed Bundle / APK again, click Browse under Key store path and choose the real file. Re-enter the alias and passwords, then continue.

# no command: Build > Generate Signed Bundle / APK > Key store path > Browse

3Verify

The wizard moves on to the destination folder step and the signed file appears under the module's build/outputs folder.

ls app/build/outputs

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

storeFile in build.gradle is resolved from the wrong folder

1Check

file("x.jks") in a module's build file is resolved against that module's project directory, not against the repository root. A path that works from the root fails when the same line sits in app/build.gradle.

grep -n "storeFile" app/build.gradle app/build.gradle.kts 2>/dev/null
ls -l app/keystore.jks

2Fix

Point storeFile at the file relative to the module folder, or use rootProject.file when the keystore sits in the repository root.

// app/build.gradle.kts
signingConfigs {
    create("release") {
        storeFile = rootProject.file("keystore.jks") // repository root
        // or: file("keystore.jks")                   // the app/ folder
    }
}

3Verify

Run the signing report. The Store line shows an existing path.

./gradlew :app:signingReport

Confirmed by docs.gradle.org

Did this fix it?

Cause 3 of 3

The path comes from keystore.properties and that file is missing or wrong

1Check

Android's documentation keeps signing data in keystore.properties in the project root, with storePassword, keyPassword, keyAlias and storeFile. That file is usually kept out of source control, so a fresh clone or a CI runner does not have it.

ls -l keystore.properties && cat keystore.properties | cut -d= -f1

2Fix

Create keystore.properties on that machine with the four keys. Set storeFile to the keystore's real location. If you have no keystore yet, create one with Build > Generate Signed Bundle / APK > Create new.

storePassword=...
keyPassword=...
keyAlias=...
storeFile=/absolute/path/to/keystore.jks

3Verify

Run the signing report and build the release artifact.

./gradlew :app:signingReport
./gradlew :app:bundleRelease

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Keep one keystore in one known location outside the project, and back it up: a lost app signing key cannot be regenerated.
  • Read signing values from keystore.properties or environment variables instead of typing paths into the dialog.
  • Use an absolute path, or rootProject.file, so the same line works for every module.

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

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

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.