Search Unity

1.1.9 Addressables.DownloadDependenciesAsync Task Bug

Discussion in 'Addressables' started by HugoClip, Aug 30, 2019.

  1. HugoClip

    HugoClip

    Joined:
    Feb 28, 2018
    Posts:
    52
    Found a bug related to awaiting
    Addressables.DownloadDependenciesAsync

    Unity Version: 2018.4.7f1
    Addressables Version: 1.1.9

    Here's a snippet to reproduce it and the stacktrace.

    Code (CSharp):
    1.  
    2. private async void Start()
    3. {
    4.   await Addressables.InitializeAsync().Task;
    5.  
    6.   await Addressables.DownloadDependenciesAsync("default").Task;
    7. }
    8.  
     
  2. HugoClip

    HugoClip

    Joined:
    Feb 28, 2018
    Posts:
    52
    Anyone else having this bug or is it just me?
     
  3. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Please test with v1.1.10 which fixed an await task bug.
     
  4. HugoClip

    HugoClip

    Joined:
    Feb 28, 2018
    Posts:
    52
    I've had that bug fixed for a while since I was actually the one who suggested the fix.
     
  5. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Sorry, I didn't recognize that, and thanks for reporting another issue.
     
  6. JL_Tech_BBW

    JL_Tech_BBW

    Joined:
    Jun 22, 2017
    Posts:
    32
    I have the exact same problem with 1.1.10.
     
  7. HugoClip

    HugoClip

    Joined:
    Feb 28, 2018
    Posts:
    52
    Here's a workaround. Not the prettiest thing out there, but oh well...

    Code (CSharp):
    1. var downloadedEndedPromise = new TaskCompletionSource<bool>();
    2. totalDownloadHandle.Completed += _ =>
    3. {
    4.     downloadedEndedPromise.SetResult(true);
    5. };
    6.  
    7. await downloadedEndedPromise.Task;
    8.  
     
  8. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    thanks for the repro snippet, we'll look into it.
     
  9. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    @unity_bill is there any update on this issue? Using Addressables version 1.2.4 this issue seems to still exist.

    calling
    Addressables.DownloadDependenciesAsync().Task
    with a label (string) as key gives a null reference.

    My workaround with an async extension:
    Code (CSharp):
    1. var dependencyTask = Addressables.DownloadDependenciesAsync("Preload", true);
    2.         await new WaitUntil(() => dependencyTask.IsDone);
     
    Last edited: Sep 27, 2019
  10. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    sorry this took so long to investigate & respond to. It was fixed in 1.11.2