Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Previous build not updating addressable changes

Discussion in 'Addressables' started by Mitjans_AmuseNetwork, Jan 11, 2019.

  1. Mitjans_AmuseNetwork


    Aug 3, 2017
    I have observed that when I make some changes in my remote bundles and upload them to the server, my previous builds do not update their content. To try to isolate the problem I have create a new project where I instantiate prefabs with a certain label, and I still get the same issue:

    I have created a remote group that contains textures and prefabs and I have added a label to my prefabs. I then instantiate all the prefabs from my server (it all works fine). When I change the label and I rebuild/update my bundles, Unity creates a new ‘catalog_***.json’ and ‘**.hash’ files, which I upload with everything else to the server. If I then try to Instantiate again from a build already created, it still instantiates the old labeled prefabs, not the new ones. If I create a new build, it gets the proper labelled prefabs as it should. Here is the code:

    public AssetLabelReference labelRef;

    private void InstantiateAddressablesWithTag()
    Addressables.LoadAssets<GameObject>(labelRef.labelString, null).Completed += OnAllLoaded;

    private void OnAllLoaded(IAsyncOperation<IList<GameObject>> operation)
    if (operation.Status == AsyncOperationStatus.Succeeded)
    var result = operation.Result;
    int count = result.Count;
    for (int i = 0; i < count; i++)
    GameObject go = Instantiate(result[i]);
    go.transform.position = UnityEngine.Random.insideUnitCircle * 10f;
    Debug.LogError("could not load objects with label: " + labelRef.labelString);

    I made sure that my bundles are marked as non ‘Static Content’, but it seems like the previous remote catalog (from previous version) still contains the old labels. I don’t understand what is happening as in my isolated project everything seems to work fine and there is nothing else in the code. I thought the already builded players should update their content from remote if any changes were found. I have also tried to clean the cache to force re-downloading the bundles.

    I have also done the ‘Build for Play Content’ procedure even though my addressables are dynamic and I thought this step wasn’t necessary and the issue was not solved.

    Also, the first time I launched play packed mode I got this exception, though I am not sure it is related (check attached image).

    What am I missing?

    For extra info: my unity version is 2018.3.1 and I am using Addressables System version 0.5.3.

    Thank you for your help!

    Attached Files:

    Muramasa666 and MNNoxMortem like this.
  2. MNNoxMortem


    Sep 11, 2016
  3. rootor


    Apr 7, 2013
    If you are using 0.5.3 I think I know what the issue is. Each time you build the bundles the catalog file gets named by the current timestamp, e.g. catalog_xyz.* where 'xyz' is the time it was built. A client built with a certain catalog file will always download the same file with the timestamp it was built with. This means that even if you build new bundles and upload to the server the old client won't know about the new catalog file.

    I have solved it for now by building bundles with a hardcoded playerVersion (Basically cloning what is in
    AddressableAssetSettings.BuildPlayerContent() but passing "1" as playerVersion):

    Code (CSharp):
    1. public class BuildAddressables
    2. {
    3.     [MenuItem("Assets/Build Addressables")]
    4.     public static void Build()
    5.     {
    6.         Debug.Log(
    7.             $"Building Addressables Player Content to {Addressables.BuildPath}/{EditorUserBuildSettings.activeBuildTarget}");
    9.         var settings = AddressableAssetSettingsDefaultObject.Settings;
    10.         if (settings == null)
    11.         {
    12.             Debug.LogError("Addressable Asset Settings does not exist.");
    13.             return;
    14.         }
    15.         if (Directory.Exists(Addressables.BuildPath))
    16.         {
    17.             try
    18.             {
    19.                 Directory.Delete(Addressables.BuildPath, true);
    20.             }
    21.             catch (Exception e)
    22.             {
    23.                 Debug.LogException(e);
    24.             }
    25.         }
    27.         var buildContext = new AddressablesBuildDataBuilderContext(settings,
    28.             BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget),
    29.             EditorUserBuildSettings.activeBuildTarget, EditorUserBuildSettings.development,
    30.             false, "1");
    31.         settings.ActivePlayerDataBuilder.BuildData<AddressablesPlayerBuildResult>(buildContext);
    32.     }
    33. }
    This way all clients, no matter when they were built, will always look at catalog_1.* and properly update content if hashes have changed.

    It can also be useful to set the 'ADDRESSABLES_LOG_ALL' preprocessor symbol in your project settings. It will print which catalog files are downloaded etc.
    MNNoxMortem likes this.
  4. MNNoxMortem


    Sep 11, 2016
    @rootor wow. I will have to try that, that sounds incredibly useful for us. Thanks!