How to debug Addressables "Object reference not set to an instance of an object" build error

In my current PC VR Project, I have to use Addressables because I’m using the Pupil Labs Neon XR package (GitHub - pupil-labs/neon-xr) for eye tracking in VR Headsets. Every time I make a build I get the below build errors. How do I debug this? I have little knowledge and experience with the Addressables package.

These errors only happen on non-first builds. When I clone the project with git (so empty Library folder etc), I don’t get these errors the first time I make a build but they come back on consecutive builds. Despite the errors, the build itself seems to work fine.

In an empty project with only the Neon XR package, I am able to build multiple times without error.

I’m using 2022.3.55f1 and also tested with 2022.3.62f1. Adressables package version is 1.22.3 (I’m not able to update this package in the package manager)

Object reference not set to an instance of an object
UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&)
AddressablesPlayerBuildProcessor:PrepareForPlayerbuild (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,UnityEditor.Build.BuildPlayerContext,bool) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:101)
AddressablesPlayerBuildProcessor:PrepareForBuild (UnityEditor.Build.BuildPlayerContext) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:80)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Addressable content build failure (duration : 0:00:00)
UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&)
AddressablesPlayerBuildProcessor:PrepareForPlayerbuild (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,UnityEditor.Build.BuildPlayerContext,bool) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:101)
AddressablesPlayerBuildProcessor:PrepareForBuild (UnityEditor.Build.BuildPlayerContext) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:80)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Failed to build Addressables content, content not included in Player Build. "Object reference not set to an instance of an object"
UnityEngine.Debug:LogError (object)
AddressablesPlayerBuildProcessor:PrepareForPlayerbuild (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,UnityEditor.Build.BuildPlayerContext,bool) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:104)
AddressablesPlayerBuildProcessor:PrepareForBuild (UnityEditor.Build.BuildPlayerContext) (at ./Library/PackageCache/com.unity.addressables@1.22.3/Editor/Build/AddressablesPlayerBuildProcessor.cs:80)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

As per Pupil Labs’ advice, these steps seem to have solved the issue for me:

  • Remove the AddressableAssetsData folder from Unity’s Project browser
  • Re-do the Addressables steps from the Neon XR Documentation (steps 2 to 4)