Search Unity

[Bug] Assets in nested subfolders are added twice during content build -> ArgumentException

Discussion in 'Addressables' started by stefankohl, Sep 16, 2019.

  1. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    49
    Please check the attach repro project.

    There is a particular asset group setup with nested folders that causes "Build Player Content" to fail due to the following exception:

    In the repro project, there is folder named "Test" containing a subfolder "Test2". "Test2" contains an asset called "MaterialB". Now I add folder "Test" to an asset group (also called "Test"). Everything works fine, "Test2" automatically gets added to the asset group as nested folder. However, when I add "Test2" separately to the same asset group, the bundle build fails because it tries to add "MaterialB" to the asset bundle twice although it is only shown once in the Addressable window (nested below Assets/Test/Test2).

    I use this setup for adding labels to all assets contained in the parent folder without labeling the child folders.
     

    Attached Files:

    BAIZOR likes this.
  2. stefankohl

    stefankohl

    Joined:
    May 30, 2014
    Posts:
    49
  3. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    988
    Seems like a straightforward bug. Thanks for posting, I'll add it to the backlog.
     
  4. ValdenaireAlexandre

    ValdenaireAlexandre

    Joined:
    Apr 15, 2016
    Posts:
    3
    We fixed it by changing the Directory.GetFiles in AddressableAssetEntry.cs which get all the files recursively by a scan directory one by one, checking if they are not marked as addressables.
     
    TextusGames likes this.
  5. RobbyZ

    RobbyZ

    Joined:
    Apr 17, 2015
    Posts:
    31
    I am also getting the ArgumentException during addressables build bug on Unity 2018.4.2f1 when I tried to upgrade Addressables last week (currently running on 1.1.5 without the exception, attempted to upgrade to 1.4.0 and got it).

    I don't think I'm using nested folders, though. I tried searching the key it failed on, and it didn't match any guids in the project (perhaps it's not keyed off guids though).

    Any word on when the fix will be released?
     
  6. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    77
    The same with Unity 2019.2.21 and Addressable 1.6.2
     
unityunity