Build Task GenerateSubAssetPathMaps failed with exception

When I try to build my project’s AssetBundles via Addressables (version 1.17.2-preview) I get this exception:

Build Task GenerateSubAssetPathMaps failed with exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <9577ac7a62ef43179789031239ba8798>:0
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <9577ac7a62ef43179789031239ba8798>:0
  at UnityEditor.Build.Pipeline.Utilities.ExtensionMethods.Swap[T] (System.Collections.Generic.IList`1[T] list, System.Int32 first, System.Int32 second) [0x00001] in C:\Users\Jesse\Unshared Code\Chromavaders\Library\PackageCache\com.unity.scriptablebuildpipeline@1.15.2\Editor\Utilities\ExtensionMethods.cs:27
  at UnityEditor.Build.Pipeline.Tasks.GenerateSubAssetPathMaps.CreateSubAssetLoadInfo (UnityEditor.Build.Content.AssetLoadInfo assetInfo, UnityEditor.Build.Content.ObjectIdentifier subAsset) [0x00052] in C:\Users\Jesse\Unshared Code\Chromavaders\Library\PackageCache\com.unity.scriptablebuildpipeline@1.15.2\Editor\Tasks\GenerateSubAssetPathMaps.cs:63
  at UnityEditor.Build.Pipeline.Tasks.GenerateSubAssetPathMaps.Run () [0x00132] in C:\Users\Jesse\Unshared Code\Chromavaders\Library\PackageCache\com.unity.scriptablebuildpipeline@1.15.2\Editor\Tasks\GenerateSubAssetPathMaps.cs:45
  at UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) [0x000ca] in C:\Users\Jesse\Unshared Code\Chromavaders\Library\PackageCache\com.unity.scriptablebuildpipeline@1.15.2\Editor\Shared\BuildTasksRunner.cs:56
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

This occurs on Windows 10, Unity 2020.2.2f1. Also, I had to disable my use of the performance testing extension, as for some reason the symbols that it requires to exist aren’t defined when compiling asset bundles.

EDIT: Fixed as of Addressables 1.17.13 and Scriptable Build Pipeline 1.17.0.

This happens even after upgrading to Addressables 1.17.4-preview and Scriptable Build Pipeline 1.16.1.

I’ll flag this for the team to have a look!

1 Like

Thank you, I appreciate it. What else can I do to help?

Not sure, but @davidla_unity may be in touch for more info.

1 Like

Hey @JesseSTG_1 thanks for bringing this to our attention. I’ll create a ticket on our end to have the SBP team look at it but I’d also go ahead and file a bug on your end. If you’re able to provide your project I think that’d be very useful for them.

Unfortunately I don’t have any greater knowledge to share. I’m also not sure when the SBP team will look at this, though they are usually pretty fast.

Understood, I’ll do that momentarily, thank you.

This issue was not fixed with Addressables 1.17.5-preview.

Hey @JesseSTG_1 . So, that issue is actually part of Scriptable Build Pipeline. I believe a ticket was created but we’ll have to wait for a new SBP release to come out before that gets resolved. Once it does we’ll update Addressables to use the fixed version of SBP.

1 Like

Dang. Well, at least I have other things I can do while waiting on this. Thanks anyway!

Just wanted to post that in Addressables 1.17.8 (coming out in a day or two) we’ll be pointing to a new version of SBP that should have a fix for your issue.

1 Like

Thank you! Fingers crossed.

Now seeing this same problem. Any update on fix availability?

Encounter the same problem after analyzing and applying fixable rules to the duplicates assets.

Oh thank Christ, I’m not crazy.

Anyone have a workaround while we wait for 1.17.8?

@davidla_unity do you have an updated ETA? Is it worth trying to patch the error with a local copy of SBP?

If anyone else is having this problem and needs an immediate temporary fix:

  • Duplicate a copy of Library/PackageCache/unity.scriptablebuildpipeline@x.x.x package into \Packages
  • Remove any version number from the package name
  • Make the folder and contents writable
  • Edit the Swap method on line #25 of ExtensionMethods.cs with either a try/catch or adding logic that prevents the out of range error

That’s it. Unsure if this is treating a symptom of a deeper problem, but my project builds bundles again.

Fix is out! Let’s take it for a spin.

EDIT: So far so good! Addressables Analyze works on all built-in analyzers (plus one custom one) without a hitch. Gonna resolve the issues it found then I’ll try to produce a build.

EDIT II: I produced a build! I am now ready to close this chapter. Thank you!

3 Likes

I have fixed it by upgrading sbp to version 1.17.0.

Saw this bug on iOS builds on versions up to verified 1.16.19
Cannot build asset groups in editor either

Seems to only happen when I included tile palette prefabs into the the addressable group.
Removed them and it builds fine. Very strange behavior