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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.