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

Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown

Discussion in 'Addressables' started by mailfromthewilds, May 30, 2020.

  1. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    215
    Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[UnityEngine.GameObject], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Assets/0 Addressables/Weapons/WoodenSword.blend, Type=UnityEngine.GameObject
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:<.ctor>b__33_0(AsyncOperationHandle)
    DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.9.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.AddressableAssets.Initialization.<>c__DisplayClass14_0:<LoadContentCatalogInternal>b__0(AsyncOperationHandle`1)
    DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.9.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted(AsyncOperationHandle`1)
    DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.9.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.9.2/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19)

    it worked until yesterday.. idk what happened. asset is there of course
     
    skwsk8 and josegarciaJC like this.
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    I'll forward this to the team for some guidance. Which version of Addressables are you using?
     
  3. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    The log above says 1.9.2 if I am not mistaken
     
  4. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Hey @mailfromthewilds just a couple of questions:
    1. you say it worked until yesterday. Did you update your package version right before it broke? Or was it working on 1.9.2 prior and then started breaking out of nowhere?
    2. Have you tried cleaning your build cache and re-building the player content?
     
  5. josegarciaJC

    josegarciaJC

    Joined:
    Sep 2, 2019
    Posts:
    2
    Having this issue too, addressables were working fine for us until today where we updated to 1.9.2. We also clear everything before rebuilding the player content
     
  6. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Very strange. I would only suggest updating to 1.11.2 and then trying to do a clean and rebuild. Perhaps you could also try deleting the com.unity.addressables folder in your projects Library folder before doing a clean rebuild. If the issue persists feel free to file a bug report. We've not seen this issue on our end so it'll help having a clear set of repro steps and a project
     
  7. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    While 1.10.0 worked super well, after upgrading to 1.11.2 I get weird errors during build. Is this a known bug?

    Code (CSharp):
    1. Build Task GenerateBundleCommands failed with exception:
    2. Index was out of range. Must be non-negative and less than the size of the collection.
    3. Parameter name: index
    4.   at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <437ba245d8404784b9fbab9b439ac908>:0
    5.   at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <437ba245d8404784b9fbab9b439ac908>:0
    6.   at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <437ba245d8404784b9fbab9b439ac908>:0
    7.   at UnityEditor.Build.Pipeline.Tasks.GenerateBundleCommands+<>c.<CreateAssetBundleCommand>b__10_2 (UnityEditor.Build.Content.AssetLoadInfo loadInfo) [0x00000] in C:\Unity\traVRsal\Library\PackageCache\com.unity.scriptablebuildpipeline@1.8.6\Editor\Tasks\GenerateBundleCommands.cs:108
    8.   at System.Linq.EnumerableSorter`2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    9.   at System.Linq.EnumerableSorter`2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count) [0x00040] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    10.   at System.Linq.EnumerableSorter`1[TElement].ComputeMap (TElement[] elements, System.Int32 count) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    11.   at System.Linq.EnumerableSorter`1[TElement].Sort (TElement[] elements, System.Int32 count) [0x00000] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    12.   at System.Linq.OrderedEnumerable`1[TElement].SortedMap (System.Linq.Buffer`1[TElement] buffer) [0x00006] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    13.   at System.Linq.OrderedEnumerable`1[TElement].ToList () [0x0001f] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    14.   at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
    15.   at UnityEditor.Build.Pipeline.Tasks.GenerateBundleCommands.CreateAssetBundleCommand (System.String bundleName, System.String internalName, System.Collections.Generic.List`1[T] assets) [0x000ad] in C:\Unity\traVRsal\Library\PackageCache\com.unity.scriptablebuildpipeline@1.8.6\Editor\Tasks\GenerateBundleCommands.cs:106
    16.   at UnityEditor.Build.Pipeline.Tasks.GenerateBundleCommands.Run () [0x00078] in C:\Unity\traVRsal\Library\PackageCache\com.unity.scriptablebuildpipeline@1.8.6\Editor\Tasks\GenerateBundleCommands.cs:63
    17.   at UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) [0x000ca] in C:\Unity\traVRsal\Library\PackageCache\com.unity.scriptablebuildpipeline@1.8.6\Editor\Shared\BuildTasksRunner.cs:56
    18. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent()
     
  8. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Ah @rwetzold, sorry you ran into that. It is a known issue and has been fixed but the fix hasn't gone out yet. I'd look for the fix to that issue in a week or two.
     
    ImpossibleRobert likes this.
  9. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    162
    I'm having this issue, too.
     
  10. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    Hi @DavidUnity3d. Any update yet on the update? Two weeks have passed :)
     
    akarpinski_unity likes this.
  11. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    This should be fixed in Scriptable Build Pipeline (SBP) 1.9.0. If you update your Addressables to 1.12.0 it'll use SBP 1.9.0 automatically. Let me know if you're still running into the issue
     
  12. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    At least on my side 1.12.0 runs excellent now :)
     
  13. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    162
    Yes, 1.12.0 + 1.9.0 is the first time Addressables run flawlessly everywhere.
     
  14. gregoryb

    gregoryb

    Joined:
    May 16, 2013
    Posts:
    1
    Thanks for this thread! I made a change to a bunch of meta files for serialized scripts and all of a sudden I couldn't build. Updating to 1.12.0 solved it.
     
    TreyK-47 likes this.
  15. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    42
    Fixed by clear everything in my case + installing SBP(scriptable build pipeline)