Addressables bundle hash changes on different machines

Hello,

Recently i have been trying to integrate addressables into my build pipeline but i have come across an issue.

I noticed when building my project bundles on the same revision on different machines, the hashes for the bundles change, which in case of using the hash in the filename causes local bundles to not be found on released versions, since obviously this file does not exist in previous builds.

I was not able to reproduce this behavior in a test project, all unchanged bundle result in the same hash on all machines.

Anyone any idea why the unchanged bundles change hashes? Or someone had a similiar Problem?

Just checked. I have the same behaviour. Checked the bundles with WebExtract + binary2text tools. The only difference in 2 similiar bundles built on different absolute paths is this:

1 Like

I still have not found a solution for this, but i will keep looking. Maybe i can find a more manual way of telling the addressables which bundles have really changed und load a seperate catalog for those remote assets.
Currently it is breaking my game and means i can’t use addressables

1 Like

I found that: the thing that affects that (for me at least) is the code here:BuildScriptPackedMode.DoBuild : 169

var builtinShaderBundleName = Hash128.Compute(GetProjectName()) + "_unitybuiltinshaders.bundle";

So the project name affects the built-in shader bundle hash and every bundle that depends on it

5 Likes

but how would the Project name generate a differrent hash, just because they are on different build machines? I have not looked in the GetProjectName() method though, does it include something specific from the build machine?

Well, project name isn’t something that has to be the same across the editors and is mostly different for everyone in my team. That’s literally a folder name where you cloned your git repo to. I’m not sure if that’s the only problem with hash stability tho. For me that was enough for a test project to make it stable

I hit this problem today. I still have no idea why the hash depends on the name of the project directory name… This is a big problem especially with Unity Cloud builds since it does not use the name of the repository as the directory name

Great finding! Unfortunately, if Unity Technologies don’t get a bug-report for this issue, chances for a fix are almost non-existent.

So I took the courtesy to submit the following bug-report:
@davidla_unity @TreyK-47

(Case 1299153) Project path affects Addressables bundle hash generation

Where the project is stored affects how Addressables generates bundles. When two people work on the same project, both checked-out the project to different directories, the generated bundles/filenames by Addressables are different. This causes content changes and requires content downloads for users, where no content changes actually occurred.

Using Unity 2019.4.16f1 and Addressables 1.16.15.

Reproduce
Please follow the video.

Actual
When no content changed, the generated bundles (filenames) are different depending on the project path.

Expected
When no content changed, the generated bundles (filenames) are the same always.

12 Likes

Thank you Jesus

1 Like

I have just come across the same issue and find this thread. Changing the folder name of the project will result in the build-in shader hashes being changed, who would expect that!

2 Likes

I believe when you change the option from Project Name Hash to Default Group GUID you can rename the folder without built-in shader hashes being different.

You can find this option in the AddressableAssetsData/AddressableAssetSettings asset.

7 Likes

The most ridiculous behaviour i have ever seen , who could possibly expect that s*** .

6 Likes