Android build cannot find the keystore file for signing
Keystore 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.
Fix it fast
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/null2Match what you see, then jump to its fix
- 1
You started the build from Build > Generate Signed Bundle / APKThe key store path in the signing dialog is wrong or the file was movedFix - 2
The 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
The 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
- 1
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.jks2Fix
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 > Browse3Verify
The wizard moves on to the destination folder step and the signed file appears under the module's build/outputs folder.
ls app/build/outputsConfirmed by developer.android.com
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.jks2Fix
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:signingReportConfirmed by docs.gradle.org
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= -f12Fix
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.jks3Verify
Run the signing report and build the release artifact.
./gradlew :app:signingReport
./gradlew :app:bundleReleaseConfirmed by developer.android.com
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
Signing a release build stops with Failed to read key from keystore
Failed to read key from keystore
Gradle opened the signing config but could not get the key out of the keystore.
3 causes, each with a fixMobile 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
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 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 fix