Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

1.16.1

Discussion in 'Addressables' started by stgs73, Sep 23, 2020.

  1. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Thanks for update but encountered one error so far

    Exception encountered in operation CompletedOperation, status=Failed, result=UnityEngine.ResourceManagement.ResourceProviders.SceneInstance : Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown.,

    when loading a scene via:

    AsyncOperationHandle<SceneInstance> scene = Addressables.LoadSceneAsync(fullPath, mode, true);

    in Fast mode only

    Digging in a bit more, the above has worked fine until this version

    thnx
     
    lejean likes this.
  2. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    * Update - when trawling through the catalog after Initialize is done, any folders with just a scene in it are completely ignored in fast mode
     
  3. pradeep2424b

    pradeep2424b

    Joined:
    Dec 4, 2019
    Posts:
    3
    any luck?
    my whole function is broken after upgrading from 1.10 to 1.16 .
    Addressable now not recognising if there is a change in the build.. Not downloading the update.
    Getting CRC error and
    Addressables.GetDownloadSizeAsync is always 0.
    These happens after upgrade.
     
  4. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    No, we reverted back to 1.13.1 again 1.14 and 1.15 had other issues for us aswell

    thnx
     
  5. joe_nk

    joe_nk

    Joined:
    Jan 6, 2017
    Posts:
    67
    We're having issues loading CSV assets from a folder marked as addressable. Only in Fast Mode, too. This is in v1.16.1. The previous version (1.15.1 didn't exhibit these issues). I'm able to hack around it.

    As a side note, I'd fully recommend writing a wrapper around the addressables API, so that if issues arise arise, you can fix them inside MyAddressablesWrapper.LoadAssetAsync
     
  6. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    328
    I'll send this post over for you @stgs73!
     
    stgs73 likes this.
  7. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Thanks for letting us know. I'll put a ticket in and we'll get this looked at asap.
     
    stgs73 likes this.
  8. PBurslem

    PBurslem

    Joined:
    Oct 30, 2014
    Posts:
    6
    Hi - I am investigating these issues. There seem to be a few things going on in this thread so I am trying to clarify the problems.
    First, it seems like loading scenes from folder marked as addressable is broken in 1.13 - From my testing it appears that this is fixed in 1.16 (possibly earlier).
    There also seems to be an unrelated issue with upgrading to 1.16 - something about data not getting built and the crcs not matching - I will need more info to investigate that issue: editor version?, was there a full data rebuild? If we can get a simple repro project that would help a lot.
    Loading csv files from a folder marked as addressable was probably broken for the same reason as the scenes, but I don't know for sure - I would need more details on how the CSV files are read.
    Thanks everyone for the feedback.
     
  9. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Hi PBurslem, thanks for looking into them,
    Our issue was simply in 1.16.1, we cannot load scenes in Editor in Fast mode only. I've done a local workaround but the catalog is not picking up folders that just contain scenes.

    thanks
     
  10. PBurslem

    PBurslem

    Joined:
    Oct 30, 2014
    Posts:
    6
    I tried to repro this - I put a scene into a new folder, marked the folder addressable, then loaded the scene via the address (folername/scene.unity) and it worked as expected. Is there something I am missing in my repro that you may be doing?
     
  11. PBurslem

    PBurslem

    Joined:
    Oct 30, 2014
    Posts:
    6
    using UnityEngine;
    using UnityEngine.AddressableAssets;
    public class LoadSceneTest : MonoBehaviour
    {
    void Start()
    {
    Addressables.LoadSceneAsync("scenes/asas.unity", UnityEngine.SceneManagement.LoadSceneMode.Additive);
    }
    }
    Untitled.png
     
  12. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    Can you try this...

    Addressables.InitializeAsync().Completed += (op) =>
    {
    IList<IResourceLocation> list = op.Result as IList<IResourceLocation>;
    foreach (IResourceLocation irl in list)
    {
    // Scenes appeared here pre 1.16.1
    }
    }
     
  13. PBurslem

    PBurslem

    Joined:
    Oct 30, 2014
    Posts:
    6
    The Result of Addressables.InitializeAsync() is AsyncOperationHandle<IResourceLocator>, not IList<IResourceLocation> but I think I know what you were getting at and I see the issue. The public IEnumerable<object> Keys property of IResourceLocator used to have ALL the keys and now it doesn't. It only contains all of the explicitly defined asset entries. Folders are not expanded until needed, etc... This was done as an optimization in order to not have to enumerate every possible addressable asset - when there are 10k+ entries with many of them folders (which could each expand to thousands), this could take very long. The new "Fast Mode" generates a minimal set of data when addressables initializes and defers as much work as possible to the individual Locate calls. This spreads out the cost of enumerating all assets and ends up being pretty negligible per load call. The downside is that the locator only knows about keys for the explicit entries. In order to make something like the Keys property (which pre-existed these optimizations) work as it did, we would have to enumerate and expand all folders. The first call to the Keys property could be VERY costly. I will add a ticket to add this, but it could be a very slow call. Do you actually need the Keys property for your project or are you just using it to show that the scenes are not showing up? The Locate method should work correctly and you should be able to load scenes and assets that are in folders even if their keys do not appear in the Keys property.
     
    stgs73 likes this.
  14. stgs73

    stgs73

    Joined:
    Mar 23, 2015
    Posts:
    59
    We are just parsing the catalog so we can store off the IResourceLocation to get quick access to loading assets later on and to store the asyncop handle off once loaded so we can release correctly later ( and also check an asset is loaded ) - this is just all wrapped up in a class for our convenience. This has been working fine up until 1.16.1.
    I think a few folks have used this pattern in some of the threads from a while back.

    I have implemented a workaround as it is editor and fast mode only so not the end of the world.

    If there is another way of dealing with this then i am all ears :) thnx
     
    Last edited: Oct 2, 2020
  15. eXistng

    eXistng

    Joined:
    Mar 3, 2017
    Posts:
    3
    Hi, guys. Just want to add some input in this thread over 1.16.1 from Unity 2019 LTS. As I have tried the last couple of days to get this Addressables thing to work with simplest task (remote content update), I can tell you that either is documentation is not up to date or I am doing some stupid things each time.
    The problem is when I try to update the remote content on the existing build (created with previous addressables content) it Is not getting updated.

    var locations = await Addressables.LoadResourceLocationsAsync(label).Task;
    foreach (var location in locations)
    await Addressables.InstantiateAsync(location).Task;

    This code always returns an old data and not the new one on the cloud.
    Want to know if there are any issues with Update previous build command as it doesn't seem like to be as stable as Build new content command.

    Any help is appreciated.


    THIS GOT SOLVED.
    Problem was outside of the Addressables package. As far as I used Google Cloud storage with public access.
    Their docs says that each object is getting cached for 3600seconds by default and thus you will receive it once you uploaded them for the next hour (even if you removed them from bucket or updated by another files).
    Got solved by running cloud shell command:
    Code (Boo):
    1. gsutil setmeta -r -h "Content-Type:text/html" -h "Cache-Control/public, max-age=0" -h "Content-Disposition" gs://YOUR_BUCKET_NAME/*
     
    Last edited: Oct 13, 2020
    stgs73 likes this.
  16. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    863
    ANY UPDATES?
     
  17. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    This should be fixed in 1.16.7+. Let us know if you're still seeing issues.
     
  18. hadesfury

    hadesfury

    Joined:
    Jan 23, 2014
    Posts:
    55
    It isn’t or is back in 1.16.19 [Verified]