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. Dismiss Notice

Question Call Addressables.LoadAssetAsync and WaitForCompletion cause an error.

Discussion in 'Addressables' started by develop_91Act, Jan 18, 2023.

  1. develop_91Act

    develop_91Act

    Joined:
    Jun 19, 2019
    Posts:
    1
    OS : windows
    Unity Version: 2021.3.13f1
    addressable: 1.21.1

    This is the code that calls Addressables.LoadAssetAsync and WaitForCompletion
    upload_2023-1-18_11-43-7.png

    and in WaitForCompletion, i got this error from UnityWebRequest, and following this post, i tried to find the exact code to dispose of the web request,

    upload_2023-1-18_11-44-15.png

    I found that in the addressable source code AssetBundleProvider.cs, there is a Dispose() in WebRequestOperationCompleted been called to that web request before IsAssetBundleDownloaded

    upload_2023-1-18_11-50-57.png

    after that Dispose(), IsAssetBundleDownloaded continued to check the same UnityWebRequest and got the _unity_self null error.

    upload_2023-1-18_11-53-35.png

    Any help will be thankful. Can i bypass this error by try-catch without any side-effect?
     
  2. xodennisxo

    xodennisxo

    Joined:
    Mar 25, 2020
    Posts:
    16
    same issue here with unity2013.3.13 + addressable1.21.1:

    ArgumentNullException: Value cannot be null.
    Parameter name: _unity_self
    UnityEngine.ResourceManagement.Util.UnityWebRequestUtilities.IsAssetBundleDownloaded