unity config_error ai_generated true

ArgumentException: AssetBundle 'characters' cannot be loaded. The bundle version (2.1.0) does not match the expected version (2.0.0).

ID: unity/asset-bundle-version-mismatch

Also available as: JSON · Markdown · 中文
85%Fix Rate
87%Confidence
1Evidence
2023-11-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2020.3 active
2021.3 active
2022.3 active

Root Cause

AssetBundle was built with a different version identifier than the one expected by the application, causing a mismatch in serialization layout.

generic

中文

资源包使用与应用程序期望不同的版本标识符构建,导致序列化布局不匹配。

Official Documentation

https://docs.unity3d.com/Manual/AssetBundlesIntro.html

Workarounds

  1. 95% success Ensure AssetBundle version is consistent by using a build script that writes the same version string. Example: AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = "characters"; build.assetNames = assets; BuildPipeline.BuildAssetBundles("Assets/AssetBundles", new[] { build }, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
    Ensure AssetBundle version is consistent by using a build script that writes the same version string. Example: AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = "characters"; build.assetNames = assets; BuildPipeline.BuildAssetBundles("Assets/AssetBundles", new[] { build }, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
  2. 80% success Clear the AssetBundle cache and force re-download: Caching.ClearCache(); then load the bundle from remote URL.
    Clear the AssetBundle cache and force re-download: Caching.ClearCache(); then load the bundle from remote URL.
  3. 85% success Use AssetBundleManifest to verify version before loading: manifest.GetAllAssetBundles() and compare version strings at runtime.
    Use AssetBundleManifest to verify version before loading: manifest.GetAllAssetBundles() and compare version strings at runtime.

中文步骤

  1. Ensure AssetBundle version is consistent by using a build script that writes the same version string. Example: AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = "characters"; build.assetNames = assets; BuildPipeline.BuildAssetBundles("Assets/AssetBundles", new[] { build }, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
  2. Clear the AssetBundle cache and force re-download: Caching.ClearCache(); then load the bundle from remote URL.
  3. Use AssetBundleManifest to verify version before loading: manifest.GetAllAssetBundles() and compare version strings at runtime.

Dead Ends

Common approaches that don't work:

  1. 60% fail

    The version mismatch is due to a version string in the bundle metadata, not the Unity version. Rebuilding without updating the version string still causes mismatch.

  2. 95% fail

    AssetBundles are binary files with checksums; manual editing corrupts the bundle and causes load failures.

  3. 80% fail

    No public API exists to skip version validation; modifying internal code is unstable and unsupported.