{
  "id": "android/room-insert-null-primary-key",
  "signature": "android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: users.id (code 1555)",
  "signature_zh": "android.database.sqlite.SQLiteConstraintException: NOT NULL 约束失败: users.id (代码 1555)",
  "regex": "SQLiteConstraintException.*NOT NULL constraint failed.*users\\.\\w+",
  "domain": "android",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Room entity has a non-null primary key field that is not auto-generated, but null value is provided during insert.",
  "root_cause_type": "generic",
  "root_cause_zh": "Room 实体具有非空主键字段且非自动生成，但插入时提供了空值。",
  "versions": [
    {
      "version": "Room 2.6.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SQLite 3.44.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 14 (API 34)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Set primary key field to nullable in entity class",
      "why_fails": "Room does not allow nullable primary keys; will cause compile error or runtime crash.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use @Ignore on primary key field to skip Room processing",
      "why_fails": "Ignores the field entirely, but then no primary key exists, breaking database operations.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add @PrimaryKey(autoGenerate = true) to the id field. Example: @PrimaryKey(autoGenerate = true) val id: Long = 0. This auto-generates unique IDs.",
      "success_rate": 0.95,
      "how": "Add @PrimaryKey(autoGenerate = true) to the id field. Example: @PrimaryKey(autoGenerate = true) val id: Long = 0. This auto-generates unique IDs.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If auto-generate not desired, ensure you assign a non-null value before insert: user.id = System.currentTimeMillis() or use UUID.randomUUID().toString() for string keys.",
      "success_rate": 0.85,
      "how": "If auto-generate not desired, ensure you assign a non-null value before insert: user.id = System.currentTimeMillis() or use UUID.randomUUID().toString() for string keys.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add @PrimaryKey(autoGenerate = true) to the id field. Example: @PrimaryKey(autoGenerate = true) val id: Long = 0. This auto-generates unique IDs.",
    "If auto-generate not desired, ensure you assign a non-null value before insert: user.id = System.currentTimeMillis() or use UUID.randomUUID().toString() for string keys."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": "1555",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2024-09-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}