Asset Bundle mismatch keeps returning.

I had an error saying that my Asset Bundles on the server were incompatible with my build so I re-built my asset bundle and re-uploaded it to the server. EVerything worked fine.

3 days later, I try to run the game again and I get the old error. My server bundles have NOT changed but my code has…but why should this affect anything?

I haver actually been finding this happening for several weeks, I keep updating the bundles and then some time later they are incompatible again.

What’s going on?

AssetBundle loading failed because the NewMainMenuManager script serialization hash does not match. Supported: 5980f0fb, loading: 516fd6b7
The asset bundle '' could not be loaded because it references scripts that are not compatible with the currently loaded ones. Rebuild the AssetBundle to fix this error.

Your bundles are referencing to scripts in your project.

When you change the scripts in the project, the script that the bundle is referencing to no longer exists (it has the same name but its not the same script).

So you have to update the bundles each time you make a change to a script that is included in the bundles.

In more detail:

When you change your script, it’s serialization value changes.

When the bundle is trying to access the script, its doing it by using the serialization value.

So as you can see from your error, the serialization value of the script is 5980f0fb but the bundle is trying to access 516fd6b7 (or it might be the other way around).

Hope this point helps:

Loading AssetBundles in the Editor
When working in the Editor requiring AssetBundles to be built and loaded can slow down the development process. For instance, if an Asset from an AssetBundle is modified this will then require the AssetBundle to be rebuilt and in a production environment it is most likely that all AssetBundles are built together and therefore making the process of updating a single AssetBundle a lengthy operation. A better approach is to have a separate code path in the Editor that will load the Asset directly instead of loading it from an AssetBundle. To do this it is possible to use Resources.LoadAssetAtPath (Editor only).