Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Addressables + UCB + CCD Combo Issue

Discussion in 'Unity Cloud Content Delivery' started by Jmangles, May 6, 2021.

  1. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    I've managed to get a project moved over to loading scenes from CCD at runtime however I can't seem to figure out how to build Addressables in Cloud Build and have them actually work in my application.

    When I upload my asset bundles/catalog/etc manually to CCD I see that the relative path is blank and my assets can be loaded at runtime from the bucket. upload_2021-5-5_19-3-7.png
    When I set Cloud Build to build my Addressables and upload them to CCD for me I notice it contains a relative path as shown here.
    upload_2021-5-5_19-4-31.png
    I tested the build and it was not able to load any scenes. Upon inspecting the error log, it was unable to find the asset bundles.
    Code (csharp):
    1. Exception encountered in operation Resource<IAssetBundleResource>(defaultlocalgroup_unitybuiltinshaders_e4dbb8311ad726f253e803db47adf1e5.bundle), status=Failed, result= : RemoteAssetBundleProvider unable to load from url https://69703558-38d0-4b40-8a45-bf665a64aa03.client-api.unity3dusercontent.com/client_api/v1/buckets/c60c44da-9ecb-4097-b828-bd60779238dc/release_by_badge/latest/entry_by_path/content/?path=/defaultlocalgroup_unitybuiltinshaders_e4dbb8311ad726f253e803db47adf1e5.bundle
    I can only assume this is from the fact they're being stored in the RemoteBuildPath.

    I attempted to make the RemoteBuildPath blank but that just made it revert to ServerData/[BuildTarget].

    I tried to make the previously built player work by building the bundles locally and uploading that to CCD instead and the application was not able to load the new assets. When I checked why, the player was trying to load the old asset bundle file names despite the fact I just uploaded two brand new catalog files.

    How can I point the player to the correct bundle url when it's in a subdirectory? Alternatively, how do I stop Cloud Build from adding that sub-path to my asset bundles when it builds the Addressables? Why did uploading all new asset bundles and the two new catalog files not point the previous standalone player to my new assets?
     
  2. unity_z5Dxmf71eBxlYQ

    unity_z5Dxmf71eBxlYQ

    Joined:
    Oct 5, 2019
    Posts:
    3
    Hi. We have a task open on this and are working to get it resolved in CloudBuild. Our goal is to eventually fix it so they both upload to the exact same place.

    I've found the work around is to have 2 different Profiles. One for local development and one for CloudBuild. In the CloudBuild profile I add:

    ?path=ServerData/StandaloneWindows/

    to the end of the RemoteURL to solve the problem.

    WRT the bundle, I would remove the hash from the bundle name. Then you can run an asset bundle build only. The build needs to have "Yes, I'd like to update a previously built Player with new Addressable Content" checked. Also keeping the bundle name the same helps. So in your Addressables settings for the bundle (click on the bundle in the Addressables Groups window), change the Bundle Naming Mode to "Filename" so that the name stays the same even if the content changes.

    We realize this is confusing right now and have a lot of changes coming up to help make it much simpler and work out of the box. Thanks for your patience and let us know if you have more issues.
     
  3. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Thanks for taking the time to reply.

    I did some more experimenting and figured out what you suggested, that I could add the RemoteBuildPath to the end of my RemoteLoadPath to make my Cloud Build + Cloud Content Delivery builds find the bundles.

    The rest of the information in this post will be for anyone who runs into another issue I had and wants to know how to solve it.

    Once I was able to load the bundles I started to get this error on all of my scenes except one:
    Scene 'TestScene.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.

    The one working scene just happened to have Internal Id Naming Mode set to Full Path in the Asset Group Schema for its Addressable Group.

    Changing all of my schemas to have the Full Path setting was the last piece of the puzzle and now my Addressables + Cloud Build + CCD all work perfect.
     
  4. Jmangles

    Jmangles

    Joined:
    Aug 1, 2015
    Posts:
    53
    Another interesting issue, after setting the Addressables Groups to use Bundle Naming setting Filename my Cloud Builds failed every time, even on a clean build. The error in my Cloud Build log is this:

    21353: [Unity] EXCEPTION: FileNotFoundException: ServerData/StandaloneWindows64/defaultlocalgroup_unitybuiltinshaders_e4dbb8311ad726f253e803db47adf1e5.bundle does not exist


    Setting them back to the setting Append Hash to Filename builds just fine.