NullReferenceException: Object reference not set to an instance of an object UnityEditor.AddressableAssets.Settings.AddressableAssetEntry.CreateCatalogEntries (System.Collections.Generic.List`1[T] entries, System.Boolean isBundled, System.String providerType, System.Collections.Generic.IEnumerable`1[T] deps, System.Object extraData) (at Library/PackageCache/com.unity.addressables@1.1.3-preview/Editor/Settings/AddressableAssetEntry.cs:478) UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.CreateLocationsForPlayerData (UnityEditor.AddressableAssets.Settings.GroupSchemas.PlayerDataGroupSchema playerDataSchema, UnityEditor.AddressableAssets.Settings.AddressableAssetGroup assetGroup, System.Collections.Generic.List`1[T] locations) (at Library/PackageCache/com.unity.addressables@1.1.3-preview/Editor/Build/DataBuilders/BuildScriptBase.cs:144) UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.ProcessPlayerDataSchema (UnityEditor.AddressableAssets.Settings.GroupSchemas.PlayerDataGroupSchema schema, UnityEditor.AddressableAssets.Settings.AddressableAssetGroup assetGroup, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.1.3-preview/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:235)
I get this error whenever I enter play mode or try to build on 1.1.3 and 1.1.4, which doesn’t seem to affect playing in the editor but does cause builds to fail. I’m not sure what might be causing my project to get into a state where the error occurs, deleting my Library folder resolves the issue. Obviously some object returned from AssetDatabase.LoadAllAssetRepresentationsAtPath(AssetPath); is null, but I’m not familiar with that API.
Hi everyone, small update, this error occures only if you have files (prefabs) with missing script, see the image. I am pretty sure that this caused the issue, also debugger helped me to find the assets. Now I am facing a different problem, “Invalid IL code in …”. Version 1.1.4 seems to be not stable.
Attach the Debugger and just walk back the call stack, one step or so. There will be a sceneasset and the corresponding path. Check the file, probably it has a missing Script.
Had similiar issues, when my groups contained filetypes that are not supported by AssetBundles (like .txt files in our case). Double check if you accidentially got some of those in, for example by marking a whole folder for being addressable.
I got this error using Addressables 1.1.10 in Unity 2018.4.8
I eventually tracked it down to a ghosted text mesh pro atlas (possibly a result of TMP automatically upgrading when I updated my project from 2018.4.1). The invalid asset was being included as a null value in the result of
AssetDatabase.LoadAllAssetRepresentationsAtPath(AssetPath).
In the project view, the TMP asset appeared to have not one but two atlases along with its base material, one of which wouldn’t show any inspector options so I guess it was broken in some way.
Updating and re-saving the TMP asset made the faulty atlas go away, and Addressables was able to build/load successfully.