{
  "id": "flutter/gradle-sign-release-key-created",
  "signature": "Gradle task assembleRelease failed with exit code 1: Execution failed for task ':app:signReleaseBundle' > Key was created with a different algorithm (RSA) than expected (EC)",
  "signature_zh": "Gradle任务assembleRelease失败，退出代码1：任务':app:signReleaseBundle'执行失败 > 密钥使用的算法（RSA）与预期（EC）不同",
  "regex": "Key was created with a different algorithm \\([A-Z]+\\) than expected \\([A-Z]+\\)",
  "domain": "flutter",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The signing key used for the release bundle was created with RSA algorithm but the Gradle configuration expects an EC (Elliptic Curve) key, or vice versa, due to a mismatch between the key type and the key store configuration.",
  "root_cause_type": "generic",
  "root_cause_zh": "用于发布包的签名密钥使用RSA算法创建，但Gradle配置期望EC（椭圆曲线）密钥，反之亦然，这是由于密钥类型与密钥库配置之间的不匹配。",
  "versions": [
    {
      "version": "Flutter 3.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Gradle Plugin 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Gradle Plugin 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Regenerate the key with the same algorithm as expected, but keep the same alias",
      "why_fails": "This invalidates the old key and requires re-uploading to Google Play Console; also the error persists if the configuration is not updated.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete the key store and create a new one with the correct algorithm",
      "why_fails": "This loses existing signing credentials and may break CI/CD pipelines that rely on the old key.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set keyAlgorithm to RSA in build.gradle",
      "why_fails": "If the actual key is EC, this still fails; the algorithm must match the key, not be hardcoded.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Update the signing configuration in android/app/build.gradle to specify the correct key algorithm that matches the key store's key, e.g., keyAlgorithm 'RSA' or 'EC'.",
      "success_rate": 0.9,
      "how": "Update the signing configuration in android/app/build.gradle to specify the correct key algorithm that matches the key store's key, e.g., keyAlgorithm 'RSA' or 'EC'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Inspect the key store to determine the actual algorithm using keytool -list -v -keystore my-release-key.jks and then set the correct algorithm in build.gradle.",
      "success_rate": 0.95,
      "how": "Inspect the key store to determine the actual algorithm using keytool -list -v -keystore my-release-key.jks and then set the correct algorithm in build.gradle.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using Android App Bundle, switch to using Play App Signing and upload the original key to Google Play, then use the upload key for local builds.",
      "success_rate": 0.85,
      "how": "If using Android App Bundle, switch to using Play App Signing and upload the original key to Google Play, then use the upload key for local builds.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Update the signing configuration in android/app/build.gradle to specify the correct key algorithm that matches the key store's key, e.g., keyAlgorithm 'RSA' or 'EC'.",
    "Inspect the key store to determine the actual algorithm using keytool -list -v -keystore my-release-key.jks and then set the correct algorithm in build.gradle.",
    "If using Android App Bundle, switch to using Play App Signing and upload the original key to Google Play, then use the upload key for local builds."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/studio/publish/app-signing",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}