Search Unity

Feedback Release and Load In the same frame will cause an error.

Discussion in 'Addressables' started by NieYanzhe, May 9, 2020.

  1. NieYanzhe

    NieYanzhe

    Joined:
    May 9, 2020
    Posts:
    2
    First I call Addressables.ReleaseInstance(gameObject) function, then call Addressables.LoadAssetAsync<T>(loadPath) function in the same frame. If gameObject and loadPath belong to the same bundle, it will casuse an error.

    ArgumentException: An item with the same key has already been added. Key: Library/com.unity.addressables/StreamingAssetsCopy/aa/Android/Android/A.bundle
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.ResourceManagement.ResourceProviders.Simulation.VirtualAssetBundleProvider.LoadAsync (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location) (at Library/PackageCache/com.unity.addressables@1.8.3/Runtime/ResourceManager/ResourceProviders/Simulation/VirtualAssetBundleProvider.cs:139)
    UnityEngine.AddressableAssets.Addressables:LoadAssetAsync(Object)
    ....
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    I'll flag for the team to take a look! Which version of the Addressables package are you using?
     
  3. NieYanzhe

    NieYanzhe

    Joined:
    May 9, 2020
    Posts:
    2
    Unity Version: 2019.3.6f1
    Addressables Version:1.7.5