{
  "id": "android/install-failed-version-downgrade",
  "signature": "INSTALL_FAILED_VERSION_DOWNGRADE: Existing version code 2 is greater than new version code 1",
  "signature_zh": "INSTALL_FAILED_VERSION_DOWNGRADE：现有版本代码 2 大于新版本代码 1",
  "regex": "INSTALL_FAILED_VERSION_DOWNGRADE: Existing version code \\d+ is greater than new version code \\d+",
  "domain": "android",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "Attempting to install an APK with a lower versionCode than the currently installed app, which Android prevents for security reasons.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试安装版本代码低于当前已安装应用的 APK，Android 出于安全原因阻止此操作。",
  "versions": [
    {
      "version": "Android 12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Studio Giraffe 2022.3.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Studio Hedgehog 2023.1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Uninstalling the app manually from device settings works but loses all user data; not ideal for debugging.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using `adb install -r -d` flag may force downgrade on some custom ROMs but fails on stock Android with version downgrade check.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Modifying versionName only without changing versionCode has no effect because versionCode is the numeric identifier.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Uninstall the existing app first: `adb uninstall com.example.app`, then install the new APK.",
      "success_rate": 1.0,
      "how": "Uninstall the existing app first: `adb uninstall com.example.app`, then install the new APK.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increment versionCode in build.gradle: `versionCode 3` (ensure it's higher than previous) and rebuild.",
      "success_rate": 0.95,
      "how": "Increment versionCode in build.gradle: `versionCode 3` (ensure it's higher than previous) and rebuild.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Uninstall the existing app first: `adb uninstall com.example.app`, then install the new APK.",
    "Increment versionCode in build.gradle: `versionCode 3` (ensure it's higher than previous) and rebuild."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/studio/command-line/adb#install",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}