# UnityEngine.AddressableAssets：初始化失败：内容目录哈希不匹配。预期为 'abc123'，实际为 'def456'。

- **ID:** `unity/addressables-catalog-hash-mismatch`
- **领域:** unity
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

本地可寻址内容目录哈希与远程目录哈希不匹配，表示本地缓存已过时或损坏。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.21.17 | active | — | — |
| 1.22.0-pre.2 | active | — | — |

## 解决方案

1. ```
   Clear the Addressables cache at runtime: `Caching.ClearCache(); Addressables.InitializeAsync();`
   ```
2. ```
   In the Editor, go to Windows > Asset Management > Addressables > Settings and click 'Clean Build' > 'All' to rebuild both local and remote catalogs.
   ```
3. ```
   Manually delete the catalog cache folder at `{persistentDataPath}/com.unity.addressables/` then reinitialize.
   ```

## 无效尝试

- **** — The hash mismatch is between local and remote catalogs; deleting settings removes the entire configuration, not just the cache. (90% 失败率)
- **** — Addressables uses its own cache in Application.persistentDataPath, not the browser cache; clearing browser cache has no effect. (95% 失败率)
- **** — Reimporting builds a new local catalog but doesn't update the remote catalog; the mismatch persists if remote hasn't been rebuilt. (60% 失败率)
