Addressable Assets still included in Build

I think I’m still missing something important about Addressables and would love some insight.

First, what I’m trying to do: to have my large assets as Addressables and loaded initially. Using the Unity CCD, I build and upload almost 200 mbs of data to my bucket, but my final .aab build doesn’t change. If I add my initial scene level, which is like 10mbs, as an Addressable scene then the final build file size jumps down significantly. If I remove that scene as an Addressable, nothing changes.

What I’m building as Addressables: FBX files, 4K textures, sound files, etc. These represent the bulk of what my scenes are comprised of, and makes the most sense to push this off to the Cloud for retrieval later.

Here is my code for the dependencies

AsyncOperationHandle downloadDependencies;

private void OnEnable()
{
      // fire off this Unity Event to let the user know that we're updating dependencies
      onStartAssetsLoading.Invoke();
      downloadDependencies = Addressables.DownloadDependenciesAsync("CloudAsset");
      downloadDependencies.Completed += DownloadDependenciesCompleted;
}

private void Update()
{
      progressBar.value = downloadDependencies.PercentComplete;
}


private void DownloadDependenciesCompleted(AsyncOperationHandle obj)
{
     if (obj.Status == AsyncOperationStatus.Succeeded)
         onAssetsDone.Invoke();// fire off event which immediately loads start menu
     else
         Debug.LogError("Loading Scene Failed");    
 }

Here is my Addressable Group setup with the CloudAsset label.

And here is the settings for my default group

Is there something else I need to do to get my CloudAssets to not be included in the .aab build?

My 2nd question pertaining to all this, going back to including my scene in the Addressable build; if I include my initial level, I then use this code to handle the Addressable Scene load:

public AssetReference initialScene;
AsyncOperationHandle asyncLevelDependencies;
       
private void Update()
{
      if (progressBar.transform.gameObject.activeInHierarchy)
            progressBar.value = asyncLevelDependencies.PercentComplete;
}

// called from the UI level selection button and displays the progress bar
public void LoadTutorialLevel()
{
      asyncLevelDependencies = Addressables.DownloadDependenciesAsync(initialScene);
      asyncLevelDependencies.Completed += DependenciesComplete;
}

private void DependenciesComplete(AsyncOperationHandle obj)
{
       if (obj.Status == AsyncOperationStatus.Succeeded)
           Addressables.LoadSceneAsync(initialScene, LoadSceneMode.Single);
       else
          Debug.LogError("Loading Scene Failed");
}

Again all of this runs fine, except when my level loads everything is Pink in the scene window and the Game window freezes showing the last Canvas screen from the level loading.

Clearly something is not getting downloaded properly, or I’m missing something else.

Hi @mcbauer to confirm you are building Addressables and your .aab locally? Is the Default Local Group using the default build path? That path evaluates to a location in Library/com.unity.addressables which ends up being copied to StreamingAssets when building the player. Unity will include StreamingAssets in one of the auto-generated .aab files. Unity - Manual: Asset packs in Unity

For the missing shaders, I can think of a few possibilities:

  1. The Default Local Group generates the built in shaders bundle. It’s possible that the bundle wasn’t uploaded to CCD. It might be preferrable to move your CloudAssets into a separate group that uses remote paths, and have your Default Local Group use local paths.
  2. You are in Play Mode and are attempting to load shaders from an Android bundle. In this case the missing shaders are expected as you are loading a bundle built for a different platform.
1 Like