Can't build for OSX from Windows (DirectoryNotFoundException: Could not find a part of the path)

DirectoryNotFoundException: Could not find a part of the path “Temp\StagingArea\Data\StreamingAssets\aa\StandaloneOSX\purplespider_assets_purplespider_diagonalstance_9e821c999a48e00f3c2c20c61dff7b24.bundle” or “Temp\StagingArea\UnityPlayer.app\Contents\Resources\Data\StreamingAssets\aa\StandaloneOSX\purplespider_assets_purplespider_diagonalstance_9e821c999a48e00f3c2c20c61dff7b24.bundle”

We’re on Unity 2018.4.17, Addressables 1.15.

I’ve tried clearing caches/restarting/upgrading - deleting the asset it errors on just causes the error to appear somewhere else.

Building works fine from a Mac, but it’s a pain to have to build on two computers.

Anyone seen this one before?

If you resolve those Temp\StagingArea.… paths to their full path what does it come out to? Do either of the full paths meet or exceed 255 characters (or 260 maybe)? It looks like issues we’ve seen in the past where the source or destination paths for the built bundles exceeds the Windows file path length max. That would explain why it works on OSX since that OS doesn’t have the same limitation.

Full path was
“C:\Users\Tom\Documents\Inkle\Pendragon\Pendragon\Pendragon Unity Project\Pendragon\Temp\StagingArea\Data\StreamingAssets\aa\StandaloneOSX\purplespider_assets_purplespider_diagonalstance_9e821c999a48e00f3c2c20c61dff7b24.bundle”

Which is apparently 225, so perhaps not?
In the end we just gave up trying to build OSX from windows :frowning:

What’s the full path of “Temp\StagingArea\UnityPlayer.app\Contents\Resources\Data\StreamingAssets\aa\StandaloneOSX\purplespider_assets_purplespider_diagonalstance_9e821c999a48e00f3c2c20c61dff7b24.bundle”? Is it “C:\Users\Tom\Documents\Inkle\Pendragon\Pendragon\Pendragon Unity Project\Pendragon\Temp\StagingArea\UnityPlayer.app\Contents\Resources\Data\StreamingAssets\aa\StandaloneOSX\purplespider_assets_purplespider_diagonalstance_9e821c999a48e00f3c2c20c61dff7b24.bundle”? because that path length is 260 which may be your problem

We had the same issue, building for macOS on Windows, it is likely the path length. We fixed it by changing the groups to use the hash of the bundle instead of appending it to the filename. This also resulted in not putting the bundles into subdirs within the RemoteBuildLocation, so shorter path names.

It seems this needs to be fixed properly in Unity or the bundled .NET though, as the Windows 10 feature of longer allowed path lengths is still not fixing it.
Some more info here:

@davidla_unity :
What about Directory Not Found Exception when building local "Packed Assets" Player Content ?

I solved the issue by moving the project to C:/[folder] instead of having it in documents. silly as it sounds (unity should use windows shortened paths) but it worked