Search Issue Tracker
Fixed in 2022.3.8f1, 2023.1.10f1, 2023.2.0b2, 2023.3.0a1
AssetBundle incremental build needs to detect script namespace/assembly change
* Open the attached project (google drive link in first comment)
* Use Menu item to Build AssetBundles
* Change the namespace in MyScripteableObject.cs
* Use the Menu item to Build AssetBundles again
* Check the console
Expected: Both AssetBundles are rebuilt with new hashes.
The test code detects that the bundle_sobject was rebuilt, but has exact same hash.
Collecting results of new Build:
[Rebuilt, identical content]: bundle_prefab
Now: Unity hash: 31a95ff8d11850cd72fc866665a946e1 Content MD5: 62aa5b9ff9a5df569c36693a7ba8cdb2 CRC: CEF9438B Write time: 5/11/2023 1:41:42 PM
Was: Unity hash: 31a95ff8d11850cd72fc866665a946e1 Content MD5: 62aa5b9ff9a5df569c36693a7ba8cdb2 CRC: CEF9438B Write time: 5/11/2023 10:28:21 AM
*WARNING* [New CRC content, but unchanged hash]: bundle_sobject
Now: Unity hash: e540d1829f3b94f916bdf7072417565f Content MD5: 18f145651eb6154fbbd49d9395fa1091 CRC: D35309F1 Write time: 5/11/2023 1:41:42 PM
Was: Unity hash: e540d1829f3b94f916bdf7072417565f Content MD5: 614754f5ff31c1ef0e7c87dd1a7d1e52 CRC: 328DB0D0 Write time: 5/11/2023 10:28:21 AM
Reproduced on 2021.3 and 2022.2 This code has not changed, so it should also reproduce in 2023.X
This is a bug in the incremental build calculation for Native AssetBundles.
The bundle is rebuilt because the TypeTreeHash is different. But the main hash is unchanged. This causes serious problems if users use that hash as a version identifier.
Because the code actually does rebuild the bundle the main workaround is to use a different value as the version hash, not the hash that Unity exposes.
I've written a detailed description of problem and ways to avoid it, and the sample test code in the repro project for detecting it.
But actually fixing the bug is also a good idea as we have such a clear understanding of it now.
We should only backport this for existing LTS versions if we add a new flag to make it opt-in. To keep such flags to an absolute minimum we should fix multiple issues at the same time. UUM-2259, UUM-16394, UUM-34924, BPSBP-764 call into that category
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [iOS] Back Triple Camera is not focusing manually and automatically
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags