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 Cloud build failed: DirectoryNotFoundException: Could not find a part of the path

Discussion in 'Unity Build Automation' started by elaine_unity694, Jul 30, 2022.

  1. elaine_unity694

    elaine_unity694

    Joined:
    Oct 12, 2020
    Posts:
    26
    Hi, everyone !

    Recently I was trying to build Amazon APK from Cloud Build, but no matter how many times I build, it seems can't find the image path and the build failed. I removed the image and add back but it didn't help neither.

    Unity version: 2020.3.26f1
    Addressable: 1.20.3


    [2022-07-29T11:37:52Z - Unity] EXCEPTION: DirectoryNotFoundException: Could not find a part of the path "Library/com.unity.addressables/aa/Android/Android\localisationfr_assets_assets/games/language/french/textures/animaladventures_lobby_spotdifferences.png_e4789812ac69d33775d3340f0d423053.bundle" or "BUILD_PATH/p\.build\last\production-amazon\extra_data\addrs\Library\com.unity.addressables\aa\Android\Android\localisationfr_assets_assets\games\language\french\textures\animaladventures_lobby_spotdifferences.png_e4789812ac69d33775d3340f0d423053.bundle"
    405: [2022-07-29T11:37:52Z - Unity] DirectoryNotFoundException: Could not find a part of the path "Library/com.unity.addressables/aa/Android/Android\localisationfr_assets_assets/games/language/french/textures/animaladventures_lobby_spotdifferences.png_e4789812ac69d33775d3340f0d423053.bundle" or "BUILD_PATH/p\.build\last\production-amazon\extra_data\addrs\Library\com.unity.addressables\aa\Android\Android\localisationfr_assets_assets\games\language\french\textures\animaladventures_lobby_spotdifferences.png_e4789812ac69d33775d3340f0d423053.bundle"
    406: [2022-07-29T11:37:52Z - Unity] ERROR: executeMethod method UnityEditor.CloudBuild.Builder.Build threw exception.
    407: [2022-07-29T11:37:53.058Z] - 6.0.2.2.4.2 - FATAL: ! Unity player export failed!
    408: Finished: FAILURE

    Thank you in advance for your help,
    Have a good day !
     
  2. elaine_unity694

    elaine_unity694

    Joined:
    Oct 12, 2020
    Posts:
    26
    It was related to this https://docs.unity.cn/Packages/com.unity.addressables@1.19/manual/BuildingContent.html

    Code (CSharp):
    1. WARNING
    2. Windows has a file path limit of 260 characters. If the build path of your content ends up creating a path that meets or exceeds the limit on Windows, the build fails. It is also possible to run into this issue if your project is located in a directory that is close to the character limit. The Scriptable Build Pipeline creates AssetBundles in a temporary directory during the build. This temporary path is a sub-directory of your project and can end up generating a string that goes over the Windows limit. If the Addressables content build fails with a Could not find a part of the path error, and you're on Windows, this is a likely culprit.
    Need to change the file path characters shorter and manually reset again the Addressable Asset Options configuration in Cloud Build.
     
    Last edited: Aug 3, 2022