{
  "id": "android/room-schema-export-missing",
  "signature": "error: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.",
  "signature_zh": "错误：未向注解处理器提供架构导出目录，因此无法导出架构。您可以提供 `room.schemaLocation` 注解处理器参数，或将 exportSchema 设置为 false。",
  "regex": "Schema export directory is not provided to the annotation processor",
  "domain": "android",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Room database annotation processor requires a schema export directory for migration validation, but it is not configured in build.gradle or exportSchema is set to true without a path.",
  "root_cause_type": "generic",
  "root_cause_zh": "Room 数据库注解处理器需要架构导出目录以进行迁移验证，但未在 build.gradle 中配置，或者 exportSchema 设置为 true 但未提供路径。",
  "versions": [
    {
      "version": "Room 2.5 - 2.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android Gradle Plugin 7.4 - 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If exportSchema is false, the schema is not exported, but the error may still occur if the processor expects the argument; the build.gradle configuration is still needed.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The path must be a valid project-relative directory; a wrong path causes the processor to fail silently or create the schema in an unexpected location.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the following to build.gradle (app-level) for kapt: 'kapt { arguments { arg(\"room.schemaLocation\", \"$projectDir/schemas\") } }' or for annotationProcessor: 'defaultConfig { javaCompileOptions { annotationProcessorOptions { arguments = [\"room.schemaLocation\": \"$projectDir/schemas\"] } } }'",
      "success_rate": 0.98,
      "how": "Add the following to build.gradle (app-level) for kapt: 'kapt { arguments { arg(\"room.schemaLocation\", \"$projectDir/schemas\") } }' or for annotationProcessor: 'defaultConfig { javaCompileOptions { annotationProcessorOptions { arguments = [\"room.schemaLocation\": \"$projectDir/schemas\"] } } }'",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set exportSchema = false in the @Database annotation if migration validation is not needed: '@Database(entities = [User::class], version = 1, exportSchema = false)'",
      "success_rate": 0.9,
      "how": "Set exportSchema = false in the @Database annotation if migration validation is not needed: '@Database(entities = [User::class], version = 1, exportSchema = false)'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add the following to build.gradle (app-level) for kapt: 'kapt { arguments { arg(\"room.schemaLocation\", \"$projectDir/schemas\") } }' or for annotationProcessor: 'defaultConfig { javaCompileOptions { annotationProcessorOptions { arguments = [\"room.schemaLocation\": \"$projectDir/schemas\"] } } }'",
    "Set exportSchema = false in the @Database annotation if migration validation is not needed: '@Database(entities = [User::class], version = 1, exportSchema = false)'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/training/data-storage/room/migrating#export-schema",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-02-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}