Search Unity

Feature Request Stop "unity_builtin_extra" from getting duplicated with Addressables

Discussion in 'Addressables' started by kloot, Mar 4, 2023.

  1. kloot

    kloot

    Joined:
    Mar 14, 2018
    Posts:
    78
    Looking at the Addressables report, "Resources/unity_builtin_extra" is the only file is getting duplicated (14 times in my case...).

    I found this kinda (awkward solution) online (you'll probably need to translate the page):
    https://zhuanlan.zhihu.com/p/386625317

    Is there more straightforward way available? It seems strange that Unitys own file should be the one culprit...

    Thanks!
     
  2. julianwitte

    julianwitte

    Joined:
    Oct 3, 2012
    Posts:
    12
    Will we ever get a solution for this?
    The workaround mentioned above is impossible when using Addressables as a package.
     
    Joshdbb and kloot like this.
  3. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    130
    The work around looks like it should work, what issues are you having? We're currently looking into the underlying issue.
     
  4. julianwitte

    julianwitte

    Joined:
    Oct 3, 2012
    Posts:
    12
    The workaround require access to internal properties and classes from the Addressable Assets package which I can't have from code out of the package assembly.

    But I ended up finding that the dependencies to "Resources/unity_builtin_extra" folders from two Remote groups on my embedded scene was actually a red herring from the Adressables Analyze Tool .

    At some point I tried to export my scene by right-clicking it and "Export as Package" and in the export window that lists all dependencies to be exported, I could find materials from the two remote groups. Embedding the materials and their textures solved my issue.

    Looks like the "Export as Package" does a better job at identifying dependencies than the Analyze Tool provided with the addressables.
    I still have no idea why it would point the "Resources/unity_builtin_extra" in those groups as dependencies, rather then showing the material assets.
     
  5. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    My general suggestion when dealing with addressables is to embed the package pretty much at all times. That way you can fix it as needed (and fixing it is needed pretty often...).

    For easy upgrades, what I do is:
    o Embed the package (move it from Library/PackageCache to Packages)
    o Rename it to drop the version from the name of the folder.
    o Commit.
    o Make any modifications.

    To upgrade:
    o Update to the commit of the unmodified version.
    o Copy the new package over the old one.
    o Commit.
    o Merge your changes in.

    Usually results in very few if any conflicts.
     
  6. Joshdbb

    Joshdbb

    Joined:
    Oct 28, 2014
    Posts:
    50
    I am also struggling with this. Any news of a fix?
     
    kloot likes this.
  7. timtunity3d

    timtunity3d

    Unity Technologies

    Joined:
    Oct 1, 2015
    Posts:
    130
    v2.0.3 has been released with a fix for this issue. We had to go with a point release since removing this content from every single asset bundle would potentially trigger a redownload of every single asset bundle. Which would be bad.

    It's pretty straightforward to backport the code into v1.21.18 (and probably earlier). You need to copy the CreateBuiltInBundle.cs build task from the 2.0.3 package into your project, and then have your build script refer to that rather than the built-in CreateBuiltInShadersBundle. There are a few things (a constant, some utility functions and imports) that you'll have to copy and paste into CreateBuiltinBundle that are in the newer package, but that's pretty straightforward.

    Change the line in your custom build script (if you don't have one there's a sample in the Samples~ folder) to refer to the new CreateBuiltinBundle task:

    ```
    //buildTasks.Add(new CreateBuiltInShadersBundle(builtinShaderBundleName));
    buildTasks.Add(new CreateBuiltInBundle(builtinShaderBundleName));
    ```

    And that should be pretty much it. The bold type above is still relevant when backporting the code, so use this with care.
     
    Core54, ArtemPavlovskyi and trin-o like this.