Search Unity

Bug Asset Bundle download getting stuck randomly

Discussion in 'Asset Bundles' started by AR_Tehcnoplus, Sep 18, 2022.

  1. AR_Tehcnoplus

    AR_Tehcnoplus

    Joined:
    Jan 17, 2022
    Posts:
    15
    Hi

    I am downloading and loading my scenes, as remote asset bundles.

    The code I am using is

    Code (CSharp):
    1.  
    2.     IEnumerator sceneDownload(AsyncOperationHandle asyncOp)
    3.     {
    4.         loadingPanel.SetActive(true);
    5.        
    6.         while (!asyncOp.IsDone)
    7.         {
    8.             float downloadPercentage = (asyncOp.GetDownloadStatus().Percent);
    9.             Debug.Log(downloadPercentage);
    10.             slider.value = downloadPercentage;
    11.             yield return null;
    12.         }
    13.  
    14.         string downloadError = GetDownloadError(asyncOp);
    15.  
    16.         if (!string.IsNullOrEmpty(downloadError))
    17.         {
    18.             StartCoroutine(DisplayNetErrorMessage());
    19.             yield break;
    20.         }
    21.  
    22.         Addressables.LoadSceneAsync(Scene,LoadSceneMode.Single).Completed +=SceneLoadCompleted;
    23.  
    24.         loadingPanel.SetActive(false);
    25.  
    26.  
    27.         yield return null;
    28.     }
    29.  
    This seems to work perfectly on Android 12.

    I downloaded the app in Android 11 and sometimes the asset bundle download gets stuck to random point. I am getting no error at all or any exception, it just gets stuck to a random point. I have noticed that sometimes it can continue after a long period.

    upload_2022-9-18_22-44-47.png
     
  2. TobiasThomsen

    TobiasThomsen

    Unity Technologies

    Joined:
    Feb 15, 2021
    Posts:
    20
    Hey AR_Tehcnoplus,
    I am moving this thread to the asset bundles forum.
     
    PoxerGames likes this.