Search Issue Tracker

Fixed

Fixed in 2022.3.8f1, 2023.1.10f1, 2023.2.0a19

Votes

1

Found in

2022.3.4f1

2023.1.0a17

2023.2.0a1

Issue ID

UUM-16394

Regression

No

Lost sprite references in bundles when moving the assets [AssetBundle Incremental Build Bug, works with UCBP]

--

-

Reproduction steps:
1. Open the user’s attached project
Open Sample Scene
Build the asset bundles by clicking on Reproduce → 1. AB pack
2. Enter Play mode
3. Observe the Game window, should show 4 unity sprites
4. Exit Play mode
5. Change assets place, by clicking on Reproduce → 2. Exchange image location
6. Rebuild the asset bundles by clicking on Reproduce → 1. AB pack
7. Enter Play mode
8. Observe the Game window

Expected result: All sprites are rendered in the Game view
Actual result: Only two of the sprites are rendered in the Game view

Reproducible with: 2020.3.40f1, 2021.3.11f1
Couldn’t test with: 2022.1.17f1, 2022.2.0b8, 2023.1.0a11 - Errors when building Asset bundles:
_Type '\[UnityEngine.TestRunner]UnityEngine.TestTools.TestRunner.PlaymodeTestsControllerSettings' has an extra field 'orderedTestNames' of type 'System.String\[]' in the player and thus can't be serialized_ 

_UnityEditor.BuildPipeline:BuildAssetBundles (string,UnityEditor.AssetBundleBuild\[],UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTarget)_

_Reproduce:Pack () (at Assets/Scripts/Editor/Reproduce.cs:41)_

Reproducible on: macOS 12.6

Also reproduced on 2023.1.0a17 Windows, not reproducible when UCBP enabled.

  1. Resolution Note:

    With this fix Unity will track dependencies between AssetBundles more precisely, so that moving an Asset between AssetBundles will trigger a rebuild of the AssetBundle referencing the Asset. However this bug fix changes the input hash calculation for all AssetBundles, which will force a rebuild of everything on the next incremental build. For that reason we only enable this fix in the 2022 backport when the BuildAssetBundleOptions.UseContentHash flag is specified. In 2023 this fix is enabled automatically.

  2. Resolution Note (fix version 2023.1.10f1):

    BuildPipeline.BuildAssetBundles now generates its hash based on the content, rather than the inputs. That resolves scenarios such as this ticket, which was caused because an AssetBundle was not rebuilt properly when an Asset it referenced changed location to another bundle.

    The input hash is now tracked as a separate hash value inside .manifest files. In 2023.X branches versions this new hashing behavior is always enabled.
    There is also a new BuildAssetBundleOptions.UseContentHash flag added, so that users of earlier Unity versions can start using this feature in an opt-in fashion. Then the flag will be ignored (and assumed enabled) when upgrading to 2023 versions.

  3. Resolution Note (fix version 2022.3.8f1):

    With this fix Unity will track dependencies between AssetBundles more precisely, so that moving an Asset between AssetBundles will trigger a rebuild of the AssetBundle referencing the Asset. However this bug fix changes the input hash calculation for all AssetBundles, which will force a rebuild of everything on the next incremental build. For that reason we only enable this fix in the 2022 backport when the BuildAssetBundleOptions.UseContentHash flag is specified. In 2023 this fix is enabled automatically.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.