I’m opening this forum post to hopefully get more visibility for the bug I’ve reported (case 1404709) as well as centralize any discussion from other users with the same issue.
-
What happened
Addressable builds fail when the File.Move destination path exceeds 255 characters. The point of failure can be seen at BuildScriptPackedMode.cs, line 982. -
How can we reproduce it using the example you attached
a. Build addressables using BuildScriptPackedMode class from the Groups window via Build > New Build > Default Build Script
b. Verify the build succeeds
c. Navigate to the material asset at Assets/asset.mat
d. Change the material’s addressable path value to a string that exceeds 255 characters (eg. this_is_a_new_addressables_asset_name_that_has_a_really_long_string_value_that_exceeds_255_characters_and_causes_an_exception_when_trying_to_copy_the_file_to_the_destination_file_path_abcdefghijklmnopqrstuvwxyz_0123456789_foo_bar_baz_qux_quux_quuz_corge.mat)
e. Attempt a build again repeating step a
f. Notice the build now fails -
Other notes
- This reproduction project uses an addressable group set to “Pack Separately”, which ends up writing a file for each asset in the group. Changing the group to “Pack Together” can still fail if you change the group name (my_group) to use a long string.
- This issue is of course dependent on the location of the Unity project on the disk.
- This issue is present in the verified addressables version 1.18.19, as well as the most recent released version 1.19.18.