PC パソコン

Android Studio “Keystore file ~ not found for signing config ‘release'”: Causes and Solutions

When you build a release APK or AAB in Android Studio, the build may stop during signing with the error “Keystore file ~ not found for signing config ‘release'”.

Error message

Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/path/to/upload-keystore.jks' not found for signing config 'release'.

This error occurs when Gradle cannot find the keystore file specified in the release signing configuration. It can happen not only when the file is missing, but also when the path is written incorrectly or a relative path is resolved from an unexpected location.

Common causes

  • The keystore file was moved or deleted
  • The path specified in storeFile is incorrect
  • The base directory for a relative path is misunderstood
  • Unnecessary quotation marks or symbols are included in key.properties
  • Windows backslashes or escaping cause the path to be interpreted incorrectly
  • The keystore is not present on another computer or in the CI environment

Step 1: Check the path shown in the error

First, inspect the full keystore path shown in the error log. If an unexpected directory appears at the beginning of the path, the relative path may be resolved from a different location than you intended.

In Flutter or multi-module projects, pay particular attention to which Gradle file is being used as the base for file(...).

Solution 1: Fix storeFile to match the actual keystore location

In a Groovy build.gradle file, you can configure the release keystore as follows.

android {
    signingConfigs {
        release {
            storeFile file('upload-keystore.jks')
            storePassword 'yourStorePassword'
            keyAlias 'upload'
            keyPassword 'yourKeyPassword'
        }
    }
}

If upload-keystore.jks is stored directly under the app module, this kind of relative path can work correctly.

Solution 2: Use an absolute path for troubleshooting

If you are not sure whether the relative path is the problem, temporarily use an absolute path to isolate the cause.

storeFile file('/Users/username/keys/upload-keystore.jks')

On Windows, using forward slashes can make the path easier to handle.

storeFile file('C:/Users/username/keys/upload-keystore.jks')

If you commit an absolute path to Git, the project may fail on other computers. For production use, environment variables or a properties file are safer options.

Solution 3: Check storeFile in key.properties

If your project uses key.properties, as many Flutter projects do, make sure the storeFile value does not contain unnecessary quotation marks.

storePassword=yourStorePassword
keyPassword=yourKeyPassword
keyAlias=upload
storeFile=C:/Users/username/keys/upload-keystore.jks

In some configurations, a value such as storeFile="C:/Users/..." can cause the quotation marks to be treated as part of the path, resulting in a path that does not exist.

Solution 4: Verify that the keystore file exists

On macOS or Linux, you can check the file directly with:

ls -l /path/to/upload-keystore.jks

You can also use Java’s keytool to verify that the keystore can be opened.

keytool -list -v -keystore /path/to/upload-keystore.jks

If the file cannot be found, fix its location. If it cannot be read, also check the keystore itself and its password.

Solution 5: Provide the keystore on other computers and CI systems

If the build works locally but fails on another computer or in CI, the keystore may be excluded from Git and therefore missing. Do not place a private signing key in a public repository. Instead, store it securely and restore it during the CI build by using secrets or another protected storage mechanism.

What to do after fixing the path

  1. Confirm that the keystore exists at the configured location
  2. Fix the path in storeFile or key.properties
  3. Run Gradle Sync
  4. Run Clean Project or rebuild the project
  5. Create the release APK or AAB again

Important note

To update an app that has already been published, you need the correct signing key associated with that app. Creating a new keystore just to remove this error can prevent you from updating the existing app.

Android’s official documentation also recommends securely storing the release keystore and correctly configuring values such as storeFile for release signing.

Summary

If you see “Keystore file ~ not found for signing config ‘release'”, first compare the path shown in the error with the actual keystore location. Check storeFile, key.properties, relative paths, Windows path syntax, and keystore placement in CI. Working through these items in order usually makes the cause easy to identify.