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

Bug The AssetBundle can't be loaded because another AssetBundle with the same files is already loaded

Discussion in 'Addressables' started by rookiemike, Dec 13, 2021.

  1. rookiemike

    rookiemike

    Joined:
    Jul 10, 2017
    Posts:
    4
    I use Addressables 1.17.13 and find the situation below will shows error when Addressables.DownloadDependenciesAsync(key) is called after a update build. (key is one label every entry has)

    3 bundle In 1 group and pack by label
    • Bundle A:
      • PrefabA1 (has monobehavior reference PrefabC)
      • PrefabA2 (has dependence PrefabA2Child)
      • PrefabA2Child
    • Bundle B:
      • PrefabB (has monobehavior reference PrefabA2Child)
    • Bundle C:
      • PrefabC
    And follow steps below it shows error "The Bundle A can't be loaded because another AssetBundle with the same files is already loaded"
    1. Build Addressable
    2. Make some changes to PrefabA2
    3. Check update
    4. Update Build Addressable
    I have already sent a bug report (Case 1388193), but i expect to know how to workaround this problem.

    I checked source code of addressable and found that when Addressables.DownloadDependenciesAsync() is called, ProvideResource() will get all bundles, and Bundle A will be required twice.(Bundle B dependence and Bundle A itself). Also the location.Hash in two times are different, because one Bundle A has dependence and the other does not.
    Then i checked the RevertUnchangedAssetsToPreviousAssetState class, in ApplyAssetEntryUpdates(),it added location of Bundle A(Bundle B dependence) when "Update Build Addressable", but the ContentCatalogDataEntry added didn't have any dependence.
    I don't know whether this is the reason for the error and how to fix it, please help.
     

    Attached Files:

  2. su9257

    su9257

    Joined:
    Jun 13, 2017
    Posts:
    27
    The same problem occurred in Unity 2021.2.x Addressables 1.19.13
     
  3. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    So this is a bug…I thought it's by design we have to notify users to restart game after DownloadDependencyAsync is done…..Thanks for the bug report and hope it can gets fixed…