Search Unity

I can not build Addressable Assets.

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

Thread Status:
Not open for further replies.
  1. m-nakayama

    m-nakayama

    Joined:
    Jun 12, 2018
    Posts:
    14
    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

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    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:
    14
    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

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    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. Mic_Emond

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    45
    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:
    723
    @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. Mic_Emond

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    45
    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:
    723
    @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. Mic_Emond

    Mic_Emond

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

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    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. Mic_Emond

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    45
    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:
    38
    Any update on this?
     
  13. AlkisFortuneFish

    AlkisFortuneFish

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

    Mic_Emond

    Joined:
    Nov 16, 2016
    Posts:
    45
    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

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    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
     
  16. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    We are running into this issue currently
    Unity Version: 2019.2.7.f2
    Addressables version: 1.3.3

    upload_2019-11-6_10-10-7.png

    upload_2019-11-6_10-10-54.png

    Based on the above posts, setting Bundle Naming to No Hash should of resolved the long build path name issue that it looks like we're seeing above.

    Any ideas? @unity_bill
     
    amesa_unity likes this.
  17. amesa_unity

    amesa_unity

    Joined:
    Oct 16, 2019
    Posts:
    5
    Same problem here:
    Unity Version: 2019.2.8.f1
    Addressables version: 1.3.3
     
  18. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    That path, once you add the actual containing path to it, is definitely longer than the max path length on Windows.

    Try HashOnly.
     
  19. skwsk8

    skwsk8

    Joined:
    Jul 6, 2014
    Posts:
    35
    I've seen the same thing, and I'd think with NoHash there wouldn't be a ton of "jdskfhdkjshfkjdhsksjlksjdfjhhlkdsf" in the filepath. Looking at the example above, "assets/vrcore/scenes/hotel.unity" seems like a short enough path that *should* work. HashOnly gave a similar error.
     
  20. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
  21. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    @unity_bill is there a regression in bundle naming with the lastest release?
     
  22. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    AlkisFortuneFish likes this.
  23. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    what you're running into there is actually an issue separate from the actual bundle naming. That error you're seeing is in the bundle caching which uses all sorts of hashes and names to store it's data. We have a change in our master branch that should fix this in most cases and will be out in our 1.4.x release in the coming weeks.
     
  24. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    @unity_bill is there any way I could get that before the fix is pushed? it's currently blocking builds.
     
  25. wangyucheng1992

    wangyucheng1992

    Joined:
    Feb 19, 2019
    Posts:
    59
  26. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
    I'm having this issue, but my colleague is not having the issue in the same project. Is there anything I can do to solve this even if it is a temporary or dirty fix? Just like @wirelessdreamer this is currently blocking builds.

    EDIT: Looks like it was a disk space problem for me.
     
    Last edited: Nov 16, 2019
  27. skwsk8

    skwsk8

    Joined:
    Jul 6, 2014
    Posts:
    35
    Any idea when 1.4.x might be coming out? It would be nice to be able to make builds :D
     
  28. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    1.4 is out now and resolves this issue.
     
  29. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    humm, I don't know what the issue is but I get this error when I build addressable. using 1.7.4

    ArgumentNullException: Value cannot be null.
    Parameter name: key
    System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (T key, System.Boolean& isNew) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:374)
    UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T].Add (System.Collections.Generic.IEnumerable`1[T] keyCollection) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:368)
    UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData+KeyIndexer`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] keyCollection, System.Int32 capacity) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:361)
    UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.SetData (System.Collections.Generic.IList`1[T] data) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:426)
    UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData..ctor (System.Collections.Generic.IList`1[T] entries, System.String id) (at Library/PackageCache/com.unity.addressables@1.7.4/Runtime/ResourceLocators/ContentCatalogData.cs:349)
    UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.DoBuild[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput, UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext aaContext) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:174)
    UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.BuildDataImplementation[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:95)
    UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase.BuildData[TResult] (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput builderInput) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Build/DataBuilders/BuildScriptBase.cs:63)
    UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContentImpl () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1700)
    UnityEditor.AddressableAssets.Settings.AddressableAssetSettings.BuildPlayerContent () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/Settings/AddressableAssetSettings.cs:1682)
    UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildPlayerData () (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:271)
    UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.OnBuildScript (System.Object context) (at Library/PackageCache/com.unity.addressables@1.7.4/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:266)
    UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at <3e481e8f36eb4d4c8d94b9ba6b2be438>:0)
     
  30. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I also get this error and play won't start in Editor, guessing the addressable build has failed.

    Player content must be built before entering play mode with packed data. This can be done from the Addressables window in the Build->Build Player Content menu command.

    However, I don't see any Build->Build Player Content menu command anywhere. Is it changed to Build->New Build->Default Build Script ?
     
    leegod likes this.
  31. Redmarian

    Redmarian

    Joined:
    Jul 6, 2017
    Posts:
    8
    I have the same issue as @castor76 , with slight variaton. Everything woks just fine in Editor, but I have his rerror on build. It's been a while, and I'm currently trying everything that was said before to no avail.
     
    leegod and Gaidzin like this.
Thread Status:
Not open for further replies.