Search Unity

Built In Shaders dependency - is it necessary?

Discussion in 'Addressables' started by aaron-PlayQ, May 23, 2020.

  1. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    I've been testing out Addressables in an existing project which made use of asset bundles for providing remote content to players via a CDN. As a test, I created a new asset group for an existing prefab and built using the packed mode (default build script). It output 2 bundles:
    If I try to just upload the main bundle to my CDN and load that, the Addressables system throws a dependency exception looking for the the unitybuiltinshaders bundle.

    Ideally I would like to remove the main bundle's dependency on a separate unitybuiltinshaders bundle. What would be the best way to go about this? Shouldn't the built in shader already be included in the build and not be needed as a separate bundle? If not, could it simply be included inside the main asset's bundle?
    Thanks!

    EDIT: Using Unity 2019.1.14 and Addressables 1.8.3
     
    Last edited: May 23, 2020
  2. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    I seem to have found the answer. I had to uncheck the "Include Resources Folders" toggle for the "Built In Data" group (see attached screenshot). Now when I rebuild only my single, expected bundle is created.
     

    Attached Files:

  3. alicht

    alicht

    Joined:
    Jan 22, 2019
    Posts:
    6
    I still get an InternalId and Key in the resulting catalog.
    Something like:
    Code (JavaScript):
    1. "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/defaultlocalgroup_unitybuiltinshaders_9a6a042faae479a7c7d3c0c5bf797553.bundle"
    Since this bundle doesn't get built, where is it pointing? Or would there be a way to strip it out?
     
  4. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    I'm running into this now as well.It seems if I delete the Default Local Group then the builtinshader dependency gets added back to my Test Asset group.
    Reviewing the documentation again, if a group (Default Local Group in this case) is set to use the LocalLoadPath then it will be copied to StreamingAssets at application build time.
     
    Last edited: May 27, 2020
  5. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    I tried moving the builtinshader.bundle from Library/com.unity.addressables/Android/Android into Assets/StreamingAssets, but had no luck. I get this exception:

    I'm using play mode script "Use Existing Build" so I can test functionality with my CDN. I have three asset groups (Built In Data, Default Local Group(empty), Test Asset Group(single prefab)). It seems to me that this builtinshader.bundle shouldn't be so hard to handle as it should be using the LocalLoadPath which is set to use the default Asset Bundle provider etc.
     
  6. IS_Twyker

    IS_Twyker

    Joined:
    Sep 6, 2021
    Posts:
    35
  7. aaron-PlayQ

    aaron-PlayQ

    Joined:
    Mar 27, 2015
    Posts:
    19
    I did not and moved on from trying to use Addressables for that project unfortunately.
     
  8. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
  9. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
    The size of default_unitybuiltinshaders_[GUID].bundle is 132 mb.
    This bundle (unlike other bundles) is going to .apk
    Unity near empty build is 30-50 mb.
    The less build possible to have is 180+ mb.
    Google Play limitation is 150 mb for .apk.

    Any idea?
    Can you suggest any workaround or solution how to download remote default_unitybuiltinshaders_[GUID].bundle?
    On any other way to be within 150 mb build?
    Thank you for reply.