{
  "id": "unity/assetdatabase-refresh-failed-locked-file",
  "signature": "AssetDatabase.Refresh failed: Could not refresh asset 'Assets/Resources/data.asset' because the file is locked by another process.",
  "signature_zh": "AssetDatabase.Refresh 失败：无法刷新资源 'Assets/Resources/data.asset'，因为文件被另一个进程锁定。",
  "regex": "AssetDatabase\\.Refresh failed: Could not refresh asset '.*' because the file is locked by another process\\.",
  "domain": "unity",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "A file in the project's Assets folder is locked by an external program (e.g., version control, text editor, or antivirus), preventing Unity from reading or writing it during refresh.",
  "root_cause_type": "generic",
  "root_cause_zh": "项目 Assets 文件夹中的文件被外部程序（例如版本控制、文本编辑器或防病毒软件）锁定，阻止 Unity 在刷新期间读取或写入它。",
  "versions": [
    {
      "version": "Unity 2020.3.0f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2021.3.0f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2022.3.0f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.2.0f1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Run Unity as administrator",
      "why_fails": "Administrator privileges do not unlock files held by other processes; the lock persists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete the locked file and recreate it",
      "why_fails": "Deleting may succeed but the new file can be locked again if the external process is still running.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Identify and close the locking process: Use tools like Sysinternals Handle.exe to find which process has a lock on the file. In Command Prompt: handle.exe -a \"Assets/Resources/data.asset\" then close the identified application (e.g., Notepad++ or Git).",
      "success_rate": 0.85,
      "how": "Identify and close the locking process: Use tools like Sysinternals Handle.exe to find which process has a lock on the file. In Command Prompt: handle.exe -a \"Assets/Resources/data.asset\" then close the identified application (e.g., Notepad++ or Git).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Exclude the Unity project folder from antivirus real-time scanning to prevent locks. Then restart Unity and perform a refresh.",
      "success_rate": 0.8,
      "how": "Exclude the Unity project folder from antivirus real-time scanning to prevent locks. Then restart Unity and perform a refresh.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Identify and close the locking process: Use tools like Sysinternals Handle.exe to find which process has a lock on the file. In Command Prompt: handle.exe -a \"Assets/Resources/data.asset\" then close the identified application (e.g., Notepad++ or Git).",
    "Exclude the Unity project folder from antivirus real-time scanning to prevent locks. Then restart Unity and perform a refresh."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/ScriptReference/AssetDatabase.Refresh.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-02-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}