Search Unity

Bug Exception while building and loading addressables

Discussion in 'Addressables' started by sebas77, Apr 27, 2021.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Better to focus on the building phase as it may point out to be a bug more clearly. While building the addressable in packed mode (release) I get this error:


    Code (CSharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    3. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.SetAssetEntriesBundleFileIdToCatalogEntryBundleFileId (System.Collections.Generic.ICollection`1[T] assetEntries, System.Collections.Generic.Dictionary`2[TKey,TValue] bundleNameToInternalBundleIdMap, UnityEditor.Build.Pipeline.Interfaces.IBundleWriteData writeData, System.Collections.Generic.Dictionary`2[TKey,TValue] locationIdToCatalogEntryMap) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:443)
    4. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.ProcessCatalogEntriesForBuild (UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext, UnityEditor.Build.Pipeline.Interfaces.IBuildLogger log, System.Collections.Generic.IEnumerable`1[T] validGroups, UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.Build.Pipeline.Interfaces.IBundleWriteData writeData, System.Collections.Generic.List`1[T] carryOverCachedState, System.Collections.Generic.Dictionary`2[TKey,TValue] bundleToInternalId) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:302)
    5. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.DoBuild[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:195)
    6. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:77)
    7. UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Build/DataBuilders/BuildScriptBase.cs:84)
    8. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/AddressableAssetSettings.cs:1874)
    9. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/AddressableAssetSettings.cs:1856)
    10. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:280)
    11. UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:275)
    12. UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <411aa9fd83b6416fab626ca292954771>:0)
    13. 1:18
    14. NullReferenceException: Object reference not set to an instance of an object
    15. UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema.get_HostingServicesContentRoot () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/GroupSchemas/BundledAssetGroupSchema.cs:259)
    16. UnityEditor.AddressableAssets.HostingServices.HostingServicesManager.GetAllContentRoots () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/HostingServices/HostingServicesManager.cs:428)
    17. UnityEditor.AddressableAssets.HostingServices.HostingServicesManager.ConfigureAllHostingServices () (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/HostingServices/HostingServicesManager.cs:405)
    18. UnityEditor.AddressableAssets.HostingServices.HostingServicesManager.OnSettingsModification (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings s, UnityEditor.AddressableAssets.Settings.AddressableAssetSettings+ModificationEvent evt, System.Object obj) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/HostingServices/HostingServicesManager.cs:398)
    19. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.SetDirty (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings+ModificationEvent modificationEvent, System.Object eventData, System.Boolean postEvent, System.Boolean settingsModified) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/AddressableAssetSettings.cs:1325)
    20. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/AddressableAssetSettings.cs:1795)
    21. UnityEditor.AddressableAssets.Settings.AddressablesAssetPostProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Library/PackageCache/com.unity.addressables@1.15.1/Editor/Settings/AddressableAssetPostProcessor.cs:39)
    22. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    23. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    24. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    25. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    26. UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at <411aa9fd83b6416fab626ca292954771>:0)
    27. UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at <411aa9fd83b6416fab626ca292954771>:0)
    28. UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
    We spent 3 hours on debugging this already, so I think we will just remove the addressables (which are HDRP volume profiles) and load them thorugh the ol' good resource folder.