juniordiscart / com.unity.addressables

Addressables extended with the ability to build multiple catalogs, ideal for traditional DLC purposes.
https://docs.unity3d.com/Packages/com.unity.addressables@1.17/manual/index.html
Other
72 stars 22 forks source link

Index out of range exception & Null Reference Exception #8

Closed Scheshi closed 1 year ago

Scheshi commented 1 year ago

When I add AddressableAssetGroup to the External Catalog, during the build I get an Index out of range exception in ContentCatalogData:726. At the moment of searching for the keys "entry.Dependencies.Select(d => keyIndexToEntries[d][0]).ToList();" A bundle that is part of the External Group has 0 occurrences, which is why this exception is thrown.

Scheshi commented 1 year ago

When I build without adding an External Catalog, but through the Multi Catalog build mode, everything is going well. Therefore, I think that somewhere on the Multi-Catalog side, the DLC dependency is removed from the bundle list.

Scheshi commented 1 year ago

Okay, 3 helped me. But now I have a NRE exception when trying to build.

ExternalCatalogSetup:85

Scheshi commented 1 year ago

Okay, the reason was that BundleFileId is null for some reason. I replaced

return assetGroups.Exists(ag => ag.entries.Any(e => e.IsFolder && e.BundleFileId.Equals(loc.InternalId)))

to

return assetGroups.Exists(ag => ag.entries.Where(x => x.BundleFileId != null)
                    .Any(e => e.IsFolder && e.BundleFileId.Equals(loc.InternalId)));

Idk why this value is null, but with such a patch it works.

juniordiscart commented 1 year ago

Do you have a set of reproduction steps for this issue?

I'll see if I can fix this up as soon as I can.

Scheshi commented 1 year ago

idk what exactly caused this behavior.

I can give information on Addressables settings:

I have 7 packages, 6 of which have such settings: image

2 packages of these 6 packages have a check mark on Prevent Updates, the rest do not have a check mark on this add-in.

Another 1 package of these 6 packages lies in ExternalCatalog

The last group is removed and looks like this: image

The settings are standard except for what I changed from your readme.md image

juniordiscart commented 1 year ago

Hi, I just pushed a merge with version 1.21.14 and applied a fix for this issue.