Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.44f1
2022.3.48f1
6000.0.21f1
6000.1.0a7
6000.2.0a1
Issue ID
UUM-82661
Regression
No
Serialization layout error occurs when loading and unloading AssetBundles in a specific sequence
How to reproduce:
1. Open the attached “IN-84251“ project
2. Open the “SampleScene“
3. Enter Play Mode
4. Observe the console window
Expect: "Content: True" is logged twice
Actual: An error, “A scripted object (script unknown or not yet loaded) has a different serialization layout when loading,” is shown, and the second log displays “Content: False”
Reproducible with: 2021.3.44f1, 2022.3.48f1, 6000.0.21f1
Reproduced on: Windows 11
Not reproduced on: No other environment tested
Notes:
The conditions required for this bug to occur are:
Step 1: Load the AssetBundle, load its dependencies, instantiate the prefab, and destroy it
Step 2: Call Resources.UnloadUnusedAssets() twice
Step 3: Unload one of the dependencies by calling AssetBundle.Unload(false) for ScriptableObjectA
Step 4: Call Resources.UnloadUnusedAssets() again.
Step 5: Reload the previously unloaded AssetBundle, instantiate the prefab from Step 1 again
The dependency structure that must be followed is:
Prefab -> ScriptableObjectA -> ScriptableObjectB -> Any Asset (which will be lost).
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Too little validation messages in the "WebAssembly Language Features" Memory settings
- Project Settings Search Highlights are misaligned when using the Bitmap Text Rendering Mode
- "GetControlID at event ValidateCommand returns a controlID different from the one in Layout event" Warning is thrown when undoing the deletion of Sprite Shape Profile
- Memory related fields in the "WebAssembly Language Features" can be set to the negative numbers
- "WebAssembly Language Features" Header in the Player Settings has a smaller indentation
Resolution Note:
Unloading an asset bundle that serves as a dependency for other asset bundles still in use can lead to undefined behavior. This includes persistent errors that may occur even if the dependency asset bundle is later reloaded. To avoid such issues, ensure that an asset bundle and all asset bundles that depend on it are unloaded together.
we have updated to api docs to clarify the usage.