# Gradle task assembleRelease failed with exit code 1: Execution failed for task ':app:signReleaseBundle' > Key was created with a different alias than the one used

- **ID:** `flutter/android-signing-key-created-with-incorrect-alias`
- **Domain:** flutter
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

The keystore file contains a key with an alias that does not match the alias specified in the signing configuration in `build.gradle`, often due to using a different keystore or regenerating keys.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Flutter 3.13.0 | active | — | — |
| Flutter 3.19.0 | active | — | — |
| Flutter 3.22.0 | active | — | — |

## Workarounds

1. **List aliases in the keystore using `keytool -list -keystore your-keystore.jks -storepass your-storepass` and update the `keyAlias` in `android/app/build.gradle` to match.** (95% success)
   ```
   List aliases in the keystore using `keytool -list -keystore your-keystore.jks -storepass your-storepass` and update the `keyAlias` in `android/app/build.gradle` to match.
   ```
2. **If the alias is correct, ensure the keystore path and passwords are correct in `key.properties` and `build.gradle`.** (85% success)
   ```
   If the alias is correct, ensure the keystore path and passwords are correct in `key.properties` and `build.gradle`.
   ```
3. **Recreate the keystore with the exact alias specified: `keytool -genkey -v -keystore release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias your-alias`.** (80% success)
   ```
   Recreate the keystore with the exact alias specified: `keytool -genkey -v -keystore release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias your-alias`.
   ```

## Dead Ends

- **** — This invalidates the old signing key, which may cause issues with app updates on the Play Store. (80% fail)
- **** — This will still not match the actual alias in the keystore; the alias must match exactly. (90% fail)
- **** — This bypasses the error but uses a debug key for release, which is insecure and not allowed for Play Store upload. (95% fail)
