Search Unity

Scriptable Build Pipeline 1.11.2 AssetBundles class stripping problem.

Discussion in 'Asset Bundles' started by FMoreno, Sep 15, 2020.

  1. FMoreno

    FMoreno

    Joined:
    Jun 21, 2018
    Posts:
    4
    Hi,

    We have a custom system for the management of asset bundles (we don’t use addressable assets) and we are planning to update it to achieve faster asset bundles builds using the caching capabilities the scriptable build pipeline offers. But we are facing some challenges.

    1.- When we use the method ContentPipeline.BuildAssetBundles this method doesn’t generate an asset bundle manifest. This is crucial for us because we use it in the BuildPipeline.BuildPlayer in the BuildPlayerOptions.assetBundleManifestPath argument to avoid asset bundles class stripping, if we don’t use this we end up errors of classes not found.

    2.- When we use the method CompatibilityBuildPipeline.BuildAssetBundles this method returns a CompatibilityAssetBundleManifest, but we lost the API to use a cache server for incremental builds of asset bundles, losing the primary goal of faster build times.
    Furthermore we don’t know if this CompatibilityAssetBundleManifest is compatible with BuildPlayerOptions.assetBundleManifestPath argument to avoid asset bundles class stripping.

    There is any way to have these two features, avoid asset bundles classes stripping and cache server integration to allow faster builds, working at the same time?

    If not, is there any timeframe when these two features will be available at the same time?

    Thanks.

    Regards.
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    Addressables & SBP generate Link.xml files now for supporting code stripping. The benefit of this approach is that we can be more detailed in what to keep vs remove, and also don't need to pass it into the build pipeline API so long as the file is located anywhere under any folder or root of the Assets/ folder. There is a known engine issue with code stripping and [SerializeReference] that is being fixed by our serialization team. To work around this, set your code stripping level to Low.
     
  3. FMoreno

    FMoreno

    Joined:
    Jun 21, 2018
    Posts:
    4
    Hi Ryanc,

    Thanks for your answer, it helps me a lot to understand how SBP works regarding code stripping.
    Unfortunately we still having stripping code issues, let me to provide you with more information:

    We are using Unity 2018.4.26
    We are not using addressable assets, we have our custom solution to deal with asset bundles.
    We already had managed stripping level configured to low in the player settings.

    I can confirm that I don't get a Link.xml file generated, so I have the following questions:

    Is Link.xml file is generated when using addressables assets and SBP? Or it should be generated when using only SBP?
    Should I create a Link.xml file manually in the root of Assets folder or do something manually in order to make it work?

    Thank you.

    Regards.
     
  4. FMoreno

    FMoreno

    Joined:
    Jun 21, 2018
    Posts:
    4
    Hi Ryanc,

    I found the way to make it work looking the code of addressable asset package. To any one having this issue you have to set WriteLinkXML variable to true in the BundleBuildParameters object. This way SBP will generate an link.xml file on the output folder of the asset bundles build. Then you have to copy this file to any folder or root of the Assets folder as Ryanc stated.

    Thanks for your input Ryan, it was fundamental to find a way to make it work.

    Regards.