Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Unable to load dependent bundle from location

Discussion in 'Addressables' started by lenamgiang, Sep 19, 2023.

  1. lenamgiang

    lenamgiang

    Joined:
    Apr 10, 2022
    Posts:
    6
    Good day, guys.

    I'd like to ask how to load assets after downloading dependencies? I can load the asset directly using LoadAssetAsync alright, but whenever I use the flow: Initialize -> Download Dependencies -> Load Assets. I got the exception (in the title). After the download, I had to reopen the game to make the Addressables work normally.

    Did I do something wrong or was I missing something?

    P/s: I'm using Unity 2022.3.0 and Addressables 1.21.15.
     
    won-gyu likes this.
  2. cengage-jsal

    cengage-jsal

    Joined:
    May 10, 2022
    Posts:
    27
    DownloadDependencies appears to be broken. I confirmed what this user said in a post I made about a similar issue you're describing.

    I finished making an addressable test environment to perform regression tests on addressable packages updates and I verified that DownloadDependencies does not load the bundle into memory, it only downloads it, so by the time LoadSceneAsync is invoked the "unable to load scene/bundle error" occurs. The error started to occur after I upgraded from 1.19.19 -> 1.21.17.

    I haven't thought about using LoadAssetAsync to manually load the asset but I can see this being an issue if you have more than one dependent bundle that needs to be loaded. I'll try it out anyway for testing sakes.

    Here's another post with a user having a similar issue after updating to 1.21.17.
     
    lenamgiang likes this.
  3. lenamgiang

    lenamgiang

    Joined:
    Apr 10, 2022
    Posts:
    6
    Thank you for the information. I'm just getting started with Addressables but facing bugs like this make me feels like not welcomed to the system.
     
  4. cengage-jsal

    cengage-jsal

    Joined:
    May 10, 2022
    Posts:
    27

    It is difficult. Especially with the contradictory information about how aspects of it work.

    The documentation mentions that DownloadDependenciesAsync() is only supposed to download and cache bundles. However, prior to the 1.21.17 update, DownloadDependenciesAsync() would also load the scene bundle into memory. Which is probably why other users suggested it to preload bundles before loading a scene/assets.

    With the most recent update, DownloadDependenciesAsync() is behaving as originally intended but now I'm left figuring out how to manually load the scene bundle without triggering that error.