AddressableAnalytics throws error during build

In my setup, AddressableAnalytics throws an error when I build. This only happens when I have a setup where I have missing AddressableAssetGroups (MissingReference) in a AddressableAssetSettings file.

This is caused by AddressableAnalytics attempting to access AddressableAssetGroup.entries in line 44.

Being able to load packages in and out of our project that contain different AddressableGroups is central to our workflow, so hope this can get fixed soon!

Thanks

@LudiKha thanks for pointing this out. Thankfully this is a simple fix so we’ll be able to get that right into the next version. In addition, if you’re comfortable editing your Addressables package, you can implement the fix yourself too as well since it’s such a simple change. Just replace

foreach (var group in currentSettings.groups)
                numberOfAddressableAssets += group.entries.Count;

(with is at line 44 of AddressableAnalytics.cs) with

foreach (var group in currentSettings.groups)
            {
                if (group == null)
                    continue;
                numberOfAddressableAssets += group.entries.Count;
            }

and I believe that should fix the issue. Thank you for your patience!

1 Like

Thanks for the timely response! Looking forward to seeing the fix.

@unity_shane While we are on the subject, GenerateLocationListsTask line 296 (method GetBundleProviderName) throws an error during analyze and build when a group doesn’t have any Schemas assigned.

@LudiKha Thanks for bringing that to our attention! This one is a bit less simple - I’m not sure that we want GenerateLocationListsTask to ignore groups with no schemas or if its better to throw an error - I’ll talk this one over with the team and get back to you.

1 Like

Cheers! The point was that it threw a non-descriptive error, which took me a bit to figure out but only after looking it up in code. So adding some exception handling with an error message would make things a bit more user friendly :slight_smile:

1 Like