unity
config_error
ai_generated
true
UnityEngine.AddressableAssets:初始化失败:内容目录哈希不匹配。预期为 'abc123',实际为 'def456'。
UnityEngine.AddressableAssets: Initialization failed: Content catalog hash mismatch. Expected 'abc123', got 'def456'.
ID: unity/addressables-catalog-hash-mismatch
85%修复率
82%置信度
1证据数
2023-11-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.21.17 | active | — | — | — |
| 1.22.0-pre.2 | active | — | — | — |
根因分析
本地可寻址内容目录哈希与远程目录哈希不匹配,表示本地缓存已过时或损坏。
English
The local addressables content catalog hash does not match the remote catalog hash, indicating a stale or corrupted local cache.
官方文档
https://docs.unity3d.com/Packages/[email protected]/manual/InitializeAsync.html解决方案
-
Clear the Addressables cache at runtime: `Caching.ClearCache(); Addressables.InitializeAsync();`
-
In the Editor, go to Windows > Asset Management > Addressables > Settings and click 'Clean Build' > 'All' to rebuild both local and remote catalogs.
-
Manually delete the catalog cache folder at `{persistentDataPath}/com.unity.addressables/` then reinitialize.
无效尝试
常见但无效的做法:
-
90% 失败
The hash mismatch is between local and remote catalogs; deleting settings removes the entire configuration, not just the cache.
-
95% 失败
Addressables uses its own cache in Application.persistentDataPath, not the browser cache; clearing browser cache has no effect.
-
60% 失败
Reimporting builds a new local catalog but doesn't update the remote catalog; the mismatch persists if remote hasn't been rebuilt.