Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Cannot build using default build script

Discussion in 'Addressables' started by Jaimi, Nov 8, 2019 at 4:36 PM.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    When I choose "Build/New Build/Default Build Script", the build works for a while, and then ends with the following error:

    ArgumentException: path
    System.IO.Path.Validate (System.String path, System.String parameterName) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    System.IO.Path.Validate (System.String path) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    System.IO.File.GetAttributes (System.String path) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
    UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.SetOutputInformation (System.String writePath, System.String finalPath, System.String bundleName, UnityEngine.Build.Pipeline.BundleDetails details) (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.5.4/Editor/Tasks/ArchiveAndCompressBundles.cs:204)
    UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.Run () (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.5.4/Editor/Tasks/ArchiveAndCompressBundles.cs:189)
    UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) (at Library/PackageCache/com.unity.scriptablebuildpipeline@1.5.4/Editor/Shared/BuildTasksRunner.cs:50)
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

    I don't know if the issue is a filepath length issue. But in case, I have done the following:

    1. Used simple names for address (no path, etc).
    2. Set "Bundle Naming" to "Only Hash".
    3. Moved the project closer to the root path

    Not sure what else to do here, as I'm not really sure what is wrong.

    Here are the settings on the groups:
    (Bundle mode is "Pack Separately" on shared items, but "Pack Together" on other groups):

    AssetBundleIssue.png
     
  2. DavidUnity3d

    DavidUnity3d

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    81
    I know you said you moved your project closer to the root but depending on how close that is, it may be that the paths of the bundles in the build cache are still too long. The final bundle destination is more than likely fine but that build cache path can get quite long, especially when packing separately.

    What version are you using? Some fixes went in somewhat recently to help try and mitigate long path issues like that, assuming that is what your problem is. Those fixes may not be in a public version yet though. I can't remember.
     
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    Thanks - I'm using 1.3.3, is there a later version?

    Is there a way to see what path is actually causing a problem? We are moving UMA over to use addressables instead of resources & Asset Bundles. If using c:/github/uma/umaproject is too much, I worry about a flood of support issues.

     
  4. DavidUnity3d

    DavidUnity3d

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    81
    Yeah, the long path stuff is a real problem. 1.3.8 should be coming out (or may already be public) so you might try and see if that helps. Though it may not. If 1.3.8 doesn't help you out go ahead and file a bug with Unity and post the case number here. I'll have to look deeper into it.
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    Thanks, I upgraded to 1.3.8, and the issue remained. I also tried turning off compression on bundles, and removed all empty groups - but saw no change.

    I've added a bug report here:

    1197350 (Open) Addressables - default build always fails with path can't be validated
     
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    @DavidUnity3d

    Found the problem. I had a colon in the generated address. Not sure why this was ever passed to the function to validate a path name (since I had naming set to "Hash only"), but that was what was causing it to break. Substituting a dash for the colon in the name let it continue through and finish building.
     
    DavidUnity3d likes this.
  7. DavidUnity3d

    DavidUnity3d

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    81
    Ah, awesome. I'm glad you were able to find a work-around. I'll still take a look at why that happened at all
     
  8. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    690
    OT, but it does look there like you are creating a group per recipe. How come?
     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    Yes - They make convenient chunks of data to load/unload, since they are all guaranteed to be used at the same time.

    This is what I am doing:

    I grab every wardrobe recipe from the global library. Then I grab all the assets out of all the recipes, and calculate if they are used by more than one recipe. Items that are used by more than one recipe go into a special "shared" group that is set to pack each item into it's own asset bundle. Items that are only in one wardrobe recipe go into a group for that recipe. Every item is labelled with a it's wardrobe recipe (some having multiple labels).

    I'm currently working on some "Preload" and "unload" functions that will take a list of wardrobe items, and preload them for a scene, so any loading time can be hidden at the beginning of the application/scene load. The unload functions will give you a way to manually clean up anything that was preloaded.

    Later, i will work on a generalized system that will demand load the recipes as needed. These will be cached, and a co-routine will clean them up after a configurable amount of time.
     
  10. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    690
    Probably should move this to a different thread or PM but is this really scaleable? In our use case it would result in about 1000 groups right now, more in future. Instead we have all recipes in one* group with PackSeparately and dependencies in a dependency group that uses a custom bundle packing mode.

    * -ish, we have a remote/local split for bundling things with the game or not.
     
  11. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,851
    I'll make a channel on the Discord for Addressables discussion.