NullReferenceException in ContentCatalogProvider

Hi,
I’m experiencing an issue with addressables failing to load.
Unfortunately I’m only seeing a few lines in the stacktrace (working on getting a full trace) and I’m yet to find where in our code this issue stems from. I’m doing some more investigation into this issue today & will update this thread once I can find some more info.
In the mean time, is this a known bug/can I work around this with particular bundle settings? Looking at the source code, this feels like an Addressables bug.

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp+BundledCatalog.WaitForCompletion () [0x00001] in C:\jenkins\workspace\proj\Library\PackageCache\com.unity.addressables@1.20.3\Runtime\ResourceProviders\ContentCatalogProvider.cs:328
UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp.WaitForCompletionCallback () [0x00020] in C:\jenkins\workspace\proj\Library\PackageCache\com.unity.addressables@1.20.3\Runtime\ResourceProviders\ContentCatalogProvider.cs:116
UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[TObject].InvokeWaitForCompletion () [0x00086] in C:\jenkins\workspace\proj\Library\PackageCache\com.unity.addressables@1.20.3\Runtime\ResourceManager\AsyncOperations\ProviderOperation.cs:74
  • We are using addressables package version 1.20.3, unity version 2020.3.37f1
  • Issue is seen on an Android build.
  • All our bundles are local, we don’t use remote bundles at all.
  • I’ve verified all groups have their build & load paths correctly set as local.
UnityEngine.AddressableAssets.Addressables.InitializeAsync(false).WaitForCompletion()

This line causes the exception to occur.
I’ve not been able to reproduce in another project or further determine any contributing factors in bundle settings etc.

Rolling back to Addressables version 1.18.19 fixes this issue for us. Due to time constraints, we’re going to roll back and forget this issue for now.

Hi @jperryoddgames thanks for posting this issue. It looks like you have the “Compress Local Catalog” setting enabled from Addressable Asset Settings. One thing you can check if the issue persists without using WaitForCompletion.

Since the issue is hard to reproduce, I would suggest submitting a bug report and if possible with your project attached.

I had a similar issue. I use the ‘Initialize Synchronously = true’ option since there are localized video / text files being loaded in Awake().

With 2 builds running from windows (server + client) it all worked fine. However when a windows build (server) and an Android (client) build were combined we got the following error only on Android:

[1]NullReferenceException: Object reference not set to an instance of an object.
  at
[2]UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp+BundledCatalog.WaitForCompletion () [0x00000] in <00000000000000000000000000000000>:0 
  at
[3]UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp.WaitForCompletionCallback () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].WaitForCompletion () [0x00000] in <00000000000000000000000000000000>:0 
  at
[4]UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject].WaitForCompletion () [0x00000] in <00000000000000000000000000000000>:0 
  at
[5]UnityEngine.ResourceManagement.ChainOperation`2[TObject,TObjectDependency].InvokeWaitForCompletion () [0x00000] in <00000000000000000000000000000000>:0 
  at
[6]UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].WaitForCompletion () [0x00000] in <0000000000000000000

It was fixed by turning off the 'Compress Local Catalog".

Thanks @ArneMarisTriangleFactory for confirming! I was able to reproduce the issue in Addressables 1.21.1. Will create a bug ticket.