{
  "id": "android/layout-constraint-layout-inflation-error",
  "signature": "android.view.InflateException: Binary XML file line #XX: Error inflating class androidx.constraintlayout.widget.ConstraintLayout",
  "signature_zh": "android.view.InflateException：二进制 XML 文件第 XX 行：膨胀类 androidx.constraintlayout.widget.ConstraintLayout 时出错",
  "regex": "android\\.view\\.InflateException: Binary XML file line #\\d+: Error inflating class androidx\\.constraintlayout\\.widget\\.ConstraintLayout",
  "domain": "android",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The ConstraintLayout dependency is missing, version mismatch, or the XML layout contains invalid attributes that prevent inflation.",
  "root_cause_type": "generic",
  "root_cause_zh": "缺少 ConstraintLayout 依赖项、版本不匹配或 XML 布局包含阻止膨胀的无效属性。",
  "versions": [
    {
      "version": "ConstraintLayout 2.1.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ConstraintLayout 2.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the version is incompatible with other libraries or the app module doesn't have the dependency, inflation fails.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This changes the layout behavior and may break UI design, but doesn't fix the underlying dependency issue.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the dependency is missing, rebuilding won't fix the classpath issue.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the ConstraintLayout dependency is in build.gradle (Module: app). Example: implementation 'androidx.constraintlayout:constraintlayout:2.1.4' and sync the project.",
      "success_rate": 0.9,
      "how": "Ensure the ConstraintLayout dependency is in build.gradle (Module: app). Example: implementation 'androidx.constraintlayout:constraintlayout:2.1.4' and sync the project.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for version conflicts by running ./gradlew :app:dependencies and ensure no duplicate or incompatible versions of ConstraintLayout are present.",
      "success_rate": 0.8,
      "how": "Check for version conflicts by running ./gradlew :app:dependencies and ensure no duplicate or incompatible versions of ConstraintLayout are present.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a library module, use 'api' instead of 'implementation' to propagate the dependency to the app module.",
      "success_rate": 0.75,
      "how": "If using a library module, use 'api' instead of 'implementation' to propagate the dependency to the app module.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保 build.gradle（模块：app）中有 ConstraintLayout 依赖项。示例：implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 并同步项目。",
    "运行 ./gradlew :app:dependencies 检查版本冲突，确保没有重复或不兼容的 ConstraintLayout 版本。",
    "如果使用库模块，使用 'api' 而不是 'implementation' 将依赖项传播到应用程序模块。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}