Error when trying to visualize details from the Profiler Addressable Module.

Whenever I am trying to access the detail panel of the profiler addressable module, I am hit with an error that prevents the presentation of the said module.

I am expecting the profiler to continue to work and to indicate what is the issue and how can I resolve the issue.

Also, note that clearing the Library Folder made it works once. (I will not clear the library each time I want to access the module)

Unity: 2022.3.11f1
Addressable: 1.21.19
Unity Profiling Core API: 1.0.2

The error:

KeyNotFoundException: The given key '2130334517' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <834b2ded5dad441e8c7a4287897d63c7>:0)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GetAssetDataForFrameData (UnityEngine.ResourceManagement.Profiling.AssetFrameData frameData, System.Collections.Generic.Dictionary`2[TKey,TValue] bundleCodeToData) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:510)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GenerateAssetData (System.Collections.Generic.List`1[T] bundleDatas, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& assetValues, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& sceneValues) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:452)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GenerateContentDataForFrame (UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView+FrameData frameData) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:420)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.ReloadData (System.Int64 selectedFrameIndex) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:218)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.OnSelectedFrameIndexChanged (System.Int64 selectedFrameIndex) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:198)
UnityEditor.ProfilerWindow.InvokeSelectedFrameIndexChangedEventIfNecessary (System.Int32 newFrame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.SetCurrentFrameDontPause (System.Int32 frame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.SetCurrentFrame (System.Int32 frame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.DoLegacyGUI_ToolbarAndCharts () (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2a6c2bf2255f4beda040b401cc7fbbeb>:0)

A second error

KeyNotFoundException: The given key '2130334517' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <834b2ded5dad441e8c7a4287897d63c7>:0)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GetAssetDataForFrameData (UnityEngine.ResourceManagement.Profiling.AssetFrameData frameData, System.Collections.Generic.Dictionary`2[TKey,TValue] bundleCodeToData) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:510)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GenerateAssetData (System.Collections.Generic.List`1[T] bundleDatas, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& assetValues, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& sceneValues) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:452)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GenerateContentDataForFrame (UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView+FrameData frameData) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:420)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.ReloadData (System.Int64 selectedFrameIndex) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:218)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.OnSelectedFrameIndexChanged (System.Int64 selectedFrameIndex) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:198)
UnityEditor.ProfilerWindow.InvokeSelectedFrameIndexChangedEventIfNecessary (System.Int32 newFrame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.SetCurrentFrameDontPause (System.Int32 frame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.SetCurrentFrame (System.Int32 frame) (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEditor.ProfilerWindow.DoLegacyGUI_ToolbarAndCharts () (at <9920ff0c944845d7b9f9a61ef1478edc>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.CallbackEventHandler.UnityEngine.UIElements.IEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPath (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7c69dfc1e63a4ea388c73014d3c7ce20>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2a6c2bf2255f4beda040b401cc7fbbeb>:0)

What I see:

We have the same issue in our project.

System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <a3b02d6f9b494355b946095ea1f25c54>:0)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GetAssetDataForFrameData (UnityEngine.ResourceManagement.Profiling.AssetFrameData frameData, System.Collections.Generic.Dictionary`2[TKey,TValue] bundleCodeToData) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:510)
UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.GenerateAssetData (System.Collections.Generic.List`1[T] bundleDatas, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& assetValues, Unity.Collections.NativeArray`1[UnityEngine.ResourceManagement.Profiling.AssetFrameData]& sceneValues) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Diagnostics/Profiler/AddressablesProfilerDetailsView.cs:452)```

Unity: 2022.3.14f1
Addressable: 1.21.19
Unity Profiling Core API: 1.0.2

PS: Restart Unity Editor fixed this problem once too, it is simpler than clearing the Library folder.

We’re seeing the same thing.

Unity 2022.3.10f
Addressables 1.21.20

Could you please file a bug report via the Editor menu Help > Report a Bug?

Same problem.

Unity: 2022.3.36f1 (LTS)
Addressables: 1.21.21

Looks like exception in UnityEditor.AddressableAssets.Diagnostics.AddressablesProfilerDetailsView.ProcessReference in line ```bundleContainingReferencedObj = bundleCodeToData[bundleCode]````

in my case referencedReportAsset.Bundle is localization-assets-shared_assets_all.bundle (Group for Localization-Assets-Shared)

I never got a confirmation that a bug was filed so, please file a bug report.

I am unable to report it with a production project, and I am unable to reproduce it in a new Unity project. However, I believe it is the same problem that was fixed in Addressables [2.2.2] - 2024-06-26 (Changelog):

  • Fix KeyNotFoundException when clicking on local bundles in the profiler.

That could be. It could also be fixed in: 2023.3.0a19, 2022.3.20f1, 2023.2.9f1, 7000.0.0a1
As that’s where an initialization issue in the profiler UI was fixed, but since you were on a newer version it’s more likely that the package fix would be the one you’re missing.

I’ll try getting a repro up. But yeah it’s difficult to do in a new project. For us, we had a WaitForCompletion call happening before Addressables were initialized, which causes this error. But… it still can happen later. I’m wondering if all WaitForCompletion calls are causing the issue. We also use Localization package.

unfortunately we can’t update to 2x version because the analyze system was removed