Bundle build fails [Could not find a part of the path ""] due to IO path issue

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.

  1. 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.

  2. 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

  3. 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.
1 Like

Thank you for sharing this. I had a similar issue with labels and solved it by using shorter labels.

Unfortunately, this is a Windows path limitation, not Unity. We could potentially give a better warning message, but the fix will still be to reduce your path lengths. For instance putting all of your source code under a high level folder like c:\src, and making sure you’re using features like “Simplify Addressable Names”.

1 Like