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 Build asset bundles for multiple platforms, to multiple buckets.

Discussion in 'Unity Cloud Content Delivery' started by filthmancer, Dec 21, 2023.

  1. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    Hi all, could you please provide further information on how to create a one click solution for building asset bundles to multiple buckets? I have separate buckets for android and iOS assets, and have set up addressable profiles that point at separate remote load paths, which works with 'Build to CCD':

    iOS Profile -> Build To CCD -> Remote Path -> iOS Bucket
    Android Profile -> Build to CCD -> Remote Path -> Android Bucket.

    This works but I would like to build and push these builds in one process, one by one. The use case is for designers to live update a word game dictionary so we need these changes on each platform synchronously. I want to have a menuitem that they can press to update the dictionary assets and push them to Unity CCD all in one step.

    Have I gone down the wrong route with separate profiles? I can't see another way to upload to separate buckets without using CCD Manager commands or CLI, which kind of makes the whole process more intensive as it isn't bundled into the asset bundle building...
    This whole process is pretty obscured and I have had a hard time tracking down the right documentation, as it seems to be split between the CCD docs and the Addressables docs. Would anyone be able to provide further documentation links for full asset bundle to CCD uploads?

    Additionally, how do separate platform builds know which bucket to pull from at runtime? Is this based on which profile is selected on build? I wasn't able to find this information in the documentation either. Would love for these docs to be more fleshed out with API samples.
    Thanks
     
  2. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    Hi, would anyone be able to give more info about this?
     
  3. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    Hi, would anyone be able to help or provide more information about this? It appears bundles have to be uploaded to different buckets per platform, and the build reads the target load from the addressable profile that has been chosen. This is pretty easy to slip up with... you could easily build using a different profile and your build will target a bucket for another platform. Is there something we can do to hard code this? I would really like to get bundle automation in as part of the build pipeline to get around this fiddly stuff with the addressables.
     
  4. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    When switching between platforms and rebuilding bundles using 'Build - New Build - Default Build Script', the addressable system often fails to open the bundles at editor runtime, with this kind of error:

    Unable to open archive file: Library/com.unity.addressables/aa/iOS/Android/defaultlocalgroup_assets_assets/...

    Notice the 'iOS/Android' section in there, which implies it is reading a catalog for the wrong platform? Or hasn't generated some references correctly? Would anyone know why this is happening?

    If I select 'Build to CCD - Default Build Script' it often fixes this issue, I can only assume because the CCD plugin is overriding some default addressable behaviour or catalog, and this isn't getting updated until I actually build to CCD. However I don't want to have to rebuild to CCD constantly just for locally bundled changes! Surely that would mean users have to redownload CCD hosted bundles that haven't changed whenever I have to rebuild bundles in editor... not good.
    Can anyone please help with any of these issues?
     
  5. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    Hi @llunity3d, is this forum still monitored? Is there somewhere else everyone can get more support for unity CCD?
     
  6. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    This is now me voidposting but let's keep going folks, hello to you all in the future. Another thing I have noticed is that overriding CCDManager.BucketID to point at another remote CCD bucket won't work if you already have a generated settings.json file (eg. com.unity.addressables/aa/iOS/settings.json) as this will force the remote dependency location for your local catalog to be whatever is set in this settings json, and setting the bucket ID won't apply.

    In relation to this, the documentation says, 'When setting up the project profile path pairs and utilizing CCD, there is an option to use Automatic'. What does this mean, where am I setting this up? I can't see anywhere to define this option, is it on the addressable groups, is there a CCD window somewhere?
     
  7. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    We're also unable to define custom variables and use them in build/load paths as part of CCD building. I have defined a BucketID and EnvironmentID variable on each addressable profile to move these hashes out of the RemoteBuildPath/RemoteLoadPath variables for readability, eg. now RemoteBuildPath says 'CCDBuildData/[EnvironmentID]/[BucketID]/latest instead of needing the hash.
    However this won't work out of the box because the catalog reader doesn't try to evaluate these variables to their build values when comparing them to the profile group types... with the not very helpful comment
    Code (CSharp):
    1. // we need the "unresolved" value since we're tring to match it to its original type
     
  8. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    Ah sorry for the earlier post about the CCDManager.BucketID, that appears to be my fault as I had hardcoded the remote load paths in my addressables group profile. I made these sections of the remote load path dynamic and it works now.
     
  9. jvasquez

    jvasquez

    Joined:
    Jan 28, 2015
    Posts:
    2
    I am experiencing a problem while trying to configure CCD for a cross-platform game. I am attempting to set up a profile using the Automatic CCD. However, when I try to execute the BuildCCD, I encounter the following error: upload_2024-4-19_22-6-45.png
     

    Attached Files:

  10. filthmancer

    filthmancer

    Joined:
    Dec 16, 2015
    Posts:
    9
    You should try exiting unity and the unity hub entirely, then opening the hub and your project again. This is probably related to the issue with unity services not keeping your login details for a new editor instance, sometimes. You can confirm if this is the case by selecting the Account dropdown on the editor's top bar. If it says you are logged out there, this will cause any CCD requests in the editor to fail.

    What is really upsetting is, if this button says you are logged out, it gives you the option to log in. But that just takes you to the hub app, which doesn't have any provided way of re-logging in. And the hub will still think you are logged in!