I just rebuilt asset bundles in Unity 2018.2.21f1. Part of the process involves switching platforms, as both WebGL and Android asset bundles are built from the same project. However, this time all of my Android hashes changed, although the contents of the files are identical. I can literally diff the binary content of the asset bundles, and they’re the same, but the hash appended to the filename via BuildAssetBundleOptions.AppendHashToAssetBundleName is different. What could cause this?
string outputPath = Path.Combine(Utility.AssetBundlesOutputPath, Utility.GetPlatformName());
BuildPipeline.BuildAssetBundles(outputPath, BuildAssetBundleOptions.AppendHashToAssetBundleName, EditorUserBuildSettings.activeBuildTarget);
I thought if I used the same machine that hashes would stay consistent across builds (and they have to date). Does switching build targets introduce a risk to my asset bundle hashes being consistent? Is there a way to convince Unity to switch back to the old hashes? I’m guessing not, since I don’t keep the Library folder in version control.
Can I fake this out client side? My intercepting hashes, finding the equivalent with a matching binary file, and then check the local cache to see if it exists? I’d prefer that I don’t force all of my Android players to have to re-download asset bundles, especially when the contents of those bundles are identical to what they likely already have cached.