We’ve recently found this issue. We’re using the custom Build Server for building our game and we’re also in a process of modifying the game to work with Addressables.
Unfortunately on our build machine (it’s running Windows 10 and Unity 2019.4.10f1) we got an exception during build:
DirectoryNotFoundException: Could not find a part of the path "Assets\StreamingAssets\DefaultAssets\Windows\StandaloneWindows64\spriteatlases_assets_assets\_game\survival\masteratlases\spaceship\shuttleinterior\shuttleinterior.spriteatlas.bundle" or "Temp\StagingArea\Data\StreamingAssets\DefaultAssets\Windows\StandaloneWindows64\spriteatlases_assets_assets\_game\survival\masteratlases\spaceship\shuttleinterior\shuttleinterior.spriteatlas.bundle"
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <fb001e01371b4adca20013e0ac763896>:0)
UnityEditor.FileUtil.UnityFileCopy (System.String from, System.String to, System.Boolean overwrite) (at <8004fcc221b54f98ba547350ea71d812>:0)
This is caused because the final path to the .bundle in in Temp\ directory (when you add the project path generated by Jenkins) has a length of 266 signs which is over 260 signs limit. We’ve reached this limit when we’ve enabled the Addressable Group to pack it’s assets separately instead of packing them toghether.
Enabling long paths in Windows registry and Group Polices didn’t help, so I think the issue is somewhere in UnityFileCopy() method. From what I know you need to use the //?/ syntax in File.Copy method if you want it to support long paths or maybe the manifest for the Unity Editor itself is not set up to inform windows that Editor supports long paths?
What I want to know is that if there is any other way than trying to shorten the paths in order to make it work at the moment?
I could not figure out how to change the filename of the built bundle. The “Simplified Entry Name” option that others had mentioned: I don’t see it anywhere.
However, changing “Bundle Naming Mode” to “Use Hash of Filename” will result in a slightly shorter name, narrowly avoiding the problem.
I do think that the Addressables package should check for long filenames, and give a legible warning, because hunting this down took a lot of time.
Hey all, I thought we had this file path length issue documented but I can’t seem to find it. I’ll make a ticket for us to document the problem and a warning, when built on Windows sounds like a good idea.
When using BundleMode=PackSeparately Addressables mirrors the project directory structure and stores the generated bundles under those mirrored folders.That’s a problem too.
Still a problem yes, unfortunately, so anyone using pack seperately is going to run into this with complex projects. Windows 10 long path is not respected. Only way to update it in C# afaik is some appconfig settings. Don’t see a way to do it in Unity.