Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

I can not build Addressable Assets.

Discussion in 'Addressables' started by m-nakayama, Jan 24, 2019.

  1. m-nakayama

    m-nakayama

    Joined:
    Jun 12, 2018
    Posts:
    8
    Hi

    I tried to build Addressable Assets In Windows machine.

    1. I built Addressable Assets in Mac.(succeeded)
    2. pushed addressableStateContent.bin, addressableAssetSettings.asset and "AssetGroups/xxxx.asset".
    3. pulled these files
    4. built Addressable Assets in Windows Machine.

    I got error message
    "

    FileNotFoundException: Library/BuildCache/ea/ea8c0d9e18fe3ab218d4f01c461618e5/268567254b73d9b88de65f641b299968/group_assets_assets/addressableassetsstore/unityassets/fileFolder/assetFileName.prefab.bundle does not exist
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
    UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.SetOutputInformation (System.String writePath, System.String finalPath, System.String bundleName, UnityEngine.Build.Pipeline.BundleDetails details) (at C:/Users/XXXXX/AppData/Local/Unity/cache/packages/staging-packages.unity.com/com.unity.scriptablebuildpipeline@1.2.1-preview/Editor/Tasks/ArchiveAndCompressBundles.cs:196)
    UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.Run () (at C:/Users/XXXXX/AppData/Local/Unity/cache/packages/staging-packages.unity.com/com.unity.scriptablebuildpipeline@1.2.1-preview/Editor/Tasks/ArchiveAndCompressBundles.cs:181)
    UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) (at C:/Users/XXXXX/AppData/Local/Unity/cache/packages/staging-packages.unity.com/com.unity.scriptablebuildpipeline@1.2.1-preview/Editor/Shared/BuildTasksRunner.cs:50)
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
    "

    thanks!
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    Two questions:
    1. you did not put your Library folder in version control, right? That definitely won't work.
    2. when you open the build settings window, is the "Target Platform" set to "Windows"?
     
  3. m-nakayama

    m-nakayama

    Joined:
    Jun 12, 2018
    Posts:
    8
    A1. Yes, I did not put Library folder in version control.
    A2. My build setting's Target platform is "Windows".

    When address name is "simplify entry name", build succeeded.
    I think there is a problem with path length.
     
  4. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    yes, on Windows there is still a limit. If your project is too deep in your folder structure, Windows will fail to make things work. :(
     
  5. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Hi!

    Any update on this? It is pretty much preventing us from building addressables right now. Depending on who in the team builds them, and how "deep" the project is, we get build errors.

    I see you've added a hash to all names? An option to just pack to hash name would be great. Right now, "pack separately" splits stuff into subfolders based on project path and that easily busts the path length limit. Pack separately to hash name and no subfolders would be great.

    Or is there any other workaround for this right now?
     
  6. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    397
    @Michael_Emond flatten your folder hierarchy, check out the unity project in the main in some location like D:\r\p\Assets\aas\*

    The reason this is a problem in the first place is that unity mirrors the folder hierarchy. @unity_bill please change that. There is no reason that the AAS needs to replicate the folder hierarchy present. I completly understand that this was the easiest way to avoid name-collision and make it debuggable by checking if the asset at the given location exists, etc, but I am very sure that flattening the hierarchy (with resolving name clashes) would absolutely work and solve the problem.
     
  7. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Hey @MNNoxMortem
    Thanks for your reply.
    I know I can "flatten" my hierarchy to semi fix it. the problem is I shouldn't have to do it and at this point I have a huge project with thousands of prefabs and other textures etc. I don't want to end up with an unmanageable project where you can't find anything because everything is in root.

    My question was more about roadmap to fix this. Or any plans really?
     
    MNNoxMortem likes this.
  8. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    397
    @Michael_Edmond I meant that the AAS should flatten the resulting hierarchy and not that you as a user should need to flatten your project hierarchy (unless it is unreasonably deep in the first place)
     
  9. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Ah yes I agree.
     
  10. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    naming the bundles after the hash is on the to-do list, and should either be in the next release or the next+1.
     
    Twyker_gp, EirikWahl and MNNoxMortem like this.
  11. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Hey! Any update on having bundles be named after their hash instead of subfolders in subfolders?
    It's gotten even worse recently with the bundles going into the build cache / library and making very very long paths. I still can't use the "pack separately" option properly.
     
  12. murat303

    murat303

    Joined:
    May 22, 2014
    Posts:
    20
    Any update on this?
     
  13. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    658
    1.1.7 allows naming bundles after their hash. I would test if that works.
     
    unity_bill likes this.
  14. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Yes it is now possible to do hash only, name + hash, or name only. For bundles being put inside folders, inside folders and creating long paths, mostly you HAVE TO use the "simplify name" option. If the name of your bundle contains " / ", it's going to try to make a folder (and subfolders for every subsequent / ).

    If you have 1 bundle that busts the max path length, building bundles will fail. I also had to upgrade my computer from 16gb of ram to 32gb, otherwise it would crash out of ram. ( but we have a pretty big project.).

    EDIT: Quick edit to add. Concerning subfolders, that it's the behavior I've been having with Pack Separately only (but I don't think it is desired? Or is it?)
     
    Last edited: Aug 23, 2019
  15. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    Two things.
    1. yes, if your addressable thing is called "x/y/thing.png" we do intentionally put the bundle in a folder structure like that. Do we need to? maybe not, but it helps with name collision
    2. we are changing the "OnlyHash" option to exclude path. So if your asset was "x/y/thing.png", in a pack separately scenario, your name options would be:
    AppendHash - x/y/thing_123abc.bundle
    NoHash - x/y/thing.bundle
    OnlyHash - 123abc.bundle