Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'Addressables' started by inkletom, Sep 2, 2020.

  1. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    63
    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?
     
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    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.
     
  3. inkletom

    inkletom

    Joined:
    Oct 13, 2016
    Posts:
    63
    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 :(
     
  4. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    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
     
  5. zauberzaubar

    zauberzaubar

    Joined:
    Jun 18, 2019
    Posts:
    53
    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:
    https://forum.unity.com/threads/dir...ng-local-packed-assets-player-content.641596/

    @davidla_unity:
    What about https://forum.unity.com/threads/dir...ed-assets-player-content.641596/#post-4508581 ?
     
  6. AbdurrahmanKhallouf

    AbdurrahmanKhallouf

    Joined:
    Oct 12, 2016
    Posts:
    2
    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