# Gradle task assembleRelease failed with exit code 1: Execution failed for task ':app:signReleaseBundle' > Key was created with errors: Key was created with errors: Invalid keystore format

- **ID:** `flutter/signing-key-creation-error`
- **Domain:** flutter
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The keystore file used for signing the release bundle is corrupted, in an unsupported format, or was created with a different Java version than the current build environment.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Flutter 3.16+ | active | — | — |
| Gradle 8.3+ | active | — | — |
| Android Studio Iguana 2023.2.1+ | active | — | — |

## Workarounds

1. **Regenerate the keystore using Java 11 or newer: keytool -genkey -v -keystore release.keystore -alias my-key -keyalg RSA -keysize 2048 -validity 10000 -storetype JKS. Then update android/key.properties with the new file path.** (85% success)
   ```
   Regenerate the keystore using Java 11 or newer: keytool -genkey -v -keystore release.keystore -alias my-key -keyalg RSA -keysize 2048 -validity 10000 -storetype JKS. Then update android/key.properties with the new file path.
   ```
2. **Convert the existing keystore to PKCS12 format: keytool -importkeystore -srckeystore old.keystore -destkeystore new.keystore -deststoretype pkcs12. Then reference the new file in key.properties.** (80% success)
   ```
   Convert the existing keystore to PKCS12 format: keytool -importkeystore -srckeystore old.keystore -destkeystore new.keystore -deststoretype pkcs12. Then reference the new file in key.properties.
   ```
3. **If using Android Studio, create a new keystore via Build > Generate Signed Bundle/APK > Create new. Ensure Java version in File > Project Structure > SDK Location matches the keystore creation version.** (90% success)
   ```
   If using Android Studio, create a new keystore via Build > Generate Signed Bundle/APK > Create new. Ensure Java version in File > Project Structure > SDK Location matches the keystore creation version.
   ```

## Dead Ends

- **** — Converting the keystore to PKCS12 format using keytool without specifying the correct alias often results in missing key entries and signature failures. (70% fail)
- **** — Deleting the keystore and creating a new one without backing up the original causes loss of the signing key, preventing app updates on the same package name. (90% fail)
- **** — Copying the keystore from another project without changing the key alias may cause signature conflicts with Google Play Store. (80% fail)
