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

Bug Addressables Profile does not recognize installed CCD Management package

Discussion in 'Unity Cloud Content Delivery' started by cambrose303, Apr 17, 2023.

  1. cambrose303

    cambrose303

    Joined:
    Oct 4, 2016
    Posts:
    13
    Just trying to get Addressables with CCD Delivery set up and there is an issue trying to select Cloud Content Delivery in the Addressables Profile Manager. Even though CCD Management 2.2.2 is installed, it claims it is not and offers to install 1.0.0 Beta. If I install the 1.0.0 Beta, I can modify the Remote Load Path but it reverts to Custom next time the Unity Editor is launched. Any idea of what I can do to fix this?

    UnityEditor 2021.3.23f1

    Thanks,
    Cam

    Screen Shot 2023-04-17 at 1.22.51 PM.png
     
  2. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    283
    Hi Cambrose303,

    Thanks for posting on the forum,
    I have seen this error before, could you try and update to Addressables version 1.21.9?
    You can update to the latest version by going to the package manager clicking on the + and adding the following package name :
     com.unity.addressables


    Make sure to backup your project prior to making any changes.

    Let me know if this solves it for you.
     
  3. cambrose303

    cambrose303

    Joined:
    Oct 4, 2016
    Posts:
    13
    Thank you. That fixed it. Follow up question...
    If I set the Remote CCD Setting to Automatic, does it automatically select the correct bucket based on platform and when it says (Set with CCD Manager), where do I find those settings?
     
  4. markmozza

    markmozza

    Joined:
    Oct 16, 2015
    Posts:
    86
    Anyone explain this?

    upload_2023-4-19_11-46-2.png

    As you can see, i dont even have the options im suppose to have after installing CCD. Also tried latest 1.21. Same thing happens.
     
  5. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    283
    Hi Cambrose303,

    Glad that helped you out.

    Automatic will automatically build and create a bucket for your use in the environment you specified.
    You should have a bucket that was automatically created for you when you use the option "Build to CCD"
    More info on the created bucket by going to your Unity dashboard.
    Unity Dashboard > LiveOps > Cloud Content Delivery > Buckets



     
  6. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    283
  7. markmozza

    markmozza

    Joined:
    Oct 16, 2015
    Posts:
    86
    @SebT_Unity

    When i open Addressable Profiles i get the following error. Althouh i can see the drop down now thanks to that guide. The error happens when i click the refresh on getting the environments from CCD.

    Code (CSharp):
    1. JsonReaderException: JSON integer 3244960947 is too large or small for an Int32. Path '[0].last_release.content_size', line 1, position 881.
    2. Newtonsoft.Json.JsonTextReader.ParseReadNumber (Newtonsoft.Json.ReadType readType, System.Char firstChar, System.Int32 initialPosition) (at /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:2238)
    3. Newtonsoft.Json.JsonTextReader.ParseNumber (Newtonsoft.Json.ReadType readType) (at /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:1973)
    4. Newtonsoft.Json.JsonTextReader.ReadNumberValue (Newtonsoft.Json.ReadType readType) (at /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:972)
    5. Newtonsoft.Json.JsonTextReader.ReadAsInt32 () (at /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:472)
    6. Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) (at /root/repo/Src/Newtonsoft.Json/JsonReader.cs:1199)
    7. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues (Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Type objectType) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:2232)
    8. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.Serialization.ObjectConstructor`1[T] creator, System.String id) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:1970)
    9. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:2327)
    10. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:493)
    11. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:309)
    12. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues (Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Type objectType) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:2243)
    13. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.Serialization.ObjectConstructor`1[T] creator, System.String id) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:1970)
    14. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:2327)
    15. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:493)
    16. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:309)
    17. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList (System.Collections.IList list, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:1713)
    18. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.Object existingValue, System.String id) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:886)
    19. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:311)
    20. Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) (at /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:202)
    21. Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at /root/repo/Src/Newtonsoft.Json/JsonSerializer.cs:904)
    22. Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at /root/repo/Src/Newtonsoft.Json/JsonSerializer.cs:883)
    23. Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) (at /root/repo/Src/Newtonsoft.Json/JsonConvert.cs:831)
    24. Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) (at /root/repo/Src/Newtonsoft.Json/JsonConvert.cs:787)
    25. Unity.Services.Ccd.Management.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Ccd.Management.Http.HttpClientResponse response) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/Http/ResponseHandler.cs:55)
    26. Rethrow as ResponseDeserializationException: JSON integer 3244960947 is too large or small for an Int32. Path '[0].last_release.content_size', line 1, position 881.
    27. Unity.Services.Ccd.Management.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Ccd.Management.Http.HttpClientResponse response) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/Http/ResponseHandler.cs:59)
    28. Unity.Services.Ccd.Management.Http.ResponseHandler.HandleAsyncResponse[T] (Unity.Services.Ccd.Management.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/Http/ResponseHandler.cs:251)
    29. Unity.Services.Ccd.Management.Apis.Buckets.BucketsApiClient.ListBucketsByProjectEnvAsync (Unity.Services.Ccd.Management.Buckets.ListBucketsByProjectEnvRequest request, Unity.Services.Ccd.Management.Configuration operationConfiguration) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/Apis/BucketsApi.cs:744)
    30. Unity.Services.Ccd.Management.WrappedCcdManagementService.TryCatchRequest[TRequest,TReturn] (System.Func`3[T1,T2,TResult] func, TRequest request, System.Boolean doEnvironmentLookup) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/SDK/WrappedCcdManagementService.cs:910)
    31. Rethrow as CcdManagementException: JSON integer 3244960947 is too large or small for an Int32. Path '[0].last_release.content_size', line 1, position 881.
    32. Unity.Services.Ccd.Management.WrappedCcdManagementService.ResolveErrorWrapping (System.Int32 reason, System.Exception exception) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/SDK/WrappedCcdManagementService.cs:1008)
    33. Unity.Services.Ccd.Management.WrappedCcdManagementService.TryCatchRequest[TRequest,TReturn] (System.Func`3[T1,T2,TResult] func, TRequest request, System.Boolean doEnvironmentLookup) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/SDK/WrappedCcdManagementService.cs:927)
    34. Unity.Services.Ccd.Management.WrappedCcdManagementService.TryCatchRequest[TRequest,TReturn] (System.Func`3[T1,T2,TResult] func, TRequest request) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/SDK/WrappedCcdManagementService.cs:884)
    35. Unity.Services.Ccd.Management.WrappedCcdManagementService.ListBucketsAsync (Unity.Services.Ccd.Management.PageOptions pageOptions) (at Library/PackageCache/com.unity.services.ccd.management@2.2.2/Editor/SDK/WrappedCcdManagementService.cs:217)
    36. UnityEditor.AddressableAssets.Settings.ProfileDataSourceSettings.GetAllBucketsAsync (System.String environment) (at Library/PackageCache/com.unity.addressables@1.21.10/Editor/Settings/ProfileDataSourceSettings.cs:357)
    37. UnityEditor.AddressableAssets.Settings.ProfileDataSourceSettings.UpdateCCDDataSourcesAsync (System.String projectId, System.Boolean showInfoLog) (at Library/PackageCache/com.unity.addressables@1.21.10/Editor/Settings/ProfileDataSourceSettings.cs:318)
    38. UnityEditor.AddressableAssets.GUI.ProfileWindow.Awake () (at Library/PackageCache/com.unity.addressables@1.21.10/Editor/GUI/ProfileWindow.cs:122)
    39. System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <4a4789deb75f446a81a24a1a00bdd3f9>:0)
    40. UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)
    41. UnityEngine.UnitySynchronizationContext.Exec () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)
    42. UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <f712b1dc50b4468388b9c5f95d0d0eaf>:0)

    upload_2023-4-19_16-33-15.png
     
    Last edited: Apr 19, 2023
  8. cambrose303

    cambrose303

    Joined:
    Oct 4, 2016
    Posts:
    13
    When I onboarded the buckets in the CCD dashboard, it set up separate buckets for iOS and Android but in the Profile Manager, it doesn't appear to understand Build Targets. Regardless of what platform I'm building for, all content builds locally into one folder and it seems to want to only address a single bucket in the Remote Load Path. Is there a way to set a separate bucket ID per platform? To keep things simple, I might just start over and build a single production bucket.
     
    sampenguin likes this.
  9. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    I think I am running into this same/similar problem. I am able to build and upload to CCD (via the Build to CCD option in Addressables Groups tab) and I see a bucket for each platform target I've tried it on (iOS, Android, and StandaloneWindows64). They also update as expected depending on what my build target is selected as in the editor.

    However, when I build to Android and run on device, it's attempting to download from the iOS bucket ID. I get a 404 error and the URL that is logged is using the iOS bucked ID.

    I can see in Addressables Profiles tab that Remote.LoadPath appears to be set correctly with Automatic(profile) setting like so:
    Code (CSharp):
    1. https://***.client-api.unity3dusercontent.com/client_api/v1/environments/{CcdManager.EnvironmentName}/buckets/{CcdManager.BucketId}/release_by_badge/{CcdManager.Badge}/entry_by_path/content/?path=
    But apparently, CcdManager.BucketId is somehow using the iOS bucket ID when I build the game for Android. Any ideas on how I can set CcdManager.BucketId correctly when building?

    Unity 2022.3.9f1, Addressables 1.21.17, CCD Management 2.2.2
     
    Last edited: Sep 22, 2023
  10. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    Update: In case this helps someone else, I tried a variety of clearing cache, rebuilding, switching the Play Mode Script to use existing build, and debug logging the CccManager.* static variables which all looked correct in the editor after a call to Addressables.InitializeAsync().

    In AddressableAssetSettings, I also checked Build Remote Catalog with Build and Load Paths set to Remote... although I did NOT do a Build to CCD after doing this.

    I'm not sure what of those things finally fixed it, but it seems to work on device now... ?
     
  11. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    OK so I just exposed this as NOT working for different environment buckets (e.g. testing-windows vs. production-windows). How are you supposed to reliably/correctly set the environment & bucket that any given game build is pointing to???

    Steps:
    1. Verified all environments have a current release in their buckets, from using Build to CCD from the Addressables Groups window by using separate testing-windows, staging-windows, and production-windows profiles.
    2. I set my active Addressables Profile to my production-windows one.
    3. I did a Clear Build Cache->All from the Addressables Groups window.
    4. I did a Build->Default Script from the Addressables Groups window.
    5. Play Mode Script is set to Use Existing Build (Windows).
    6. I did a full standalone build of the game from the editor.

    My game calls UnityServices.InitializeAsync and sets the environment to production (from a variable in a manager GameObject called environmentUGS):

    var options = new InitializationOptions();
    options.SetEnvironmentName(environmentUGS.ToString());
    await UnityServices.InitializeAsync(options);


    After that returns, I initialize Addressables:

    Addressables.InitializeAsync().Completed += OnAddressablesInitializeComplete;


    In the callback OnAddressablesInitializeComplete, I print out the CcdManager variables, and they are wrong. Still pointing at the testing environment and the wrong bucket ID.

    Tested this both in Editor (with Settings->Services->Environments->Environment Selector set to production) and with a standalone windows build, same result.
     
    kdchabuk likes this.
  12. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    Found where this is happening. There is definitely a major bug of some kind here:

    If you open AddressableAssetSettings object in the inspector, you'll see at the bottom of the inspector something called "Cloud Content Delivery" and a checkbox to "Enable CCD Features". In my case, ticking this box does nothing, it stays unselected. Despite the fact that I can "Build to CCD" from the Addressables groups windows.

    However, if you set your inspector to Debug view, now at the bottom you'll see a lovely little drop down of a struct or something called "Ccd Managed Data"
    In there are all the wrong values that my game keeps using, despite the active profile being set. So there's a bug in Addressables package right now that either/or that checkbox not working is preventing changing the active profile from updating this hidden little data store that then gets passed around at game build time.

    Update: I can check "CCD Enabled" in Debug inspector. Doesn't fix the issue.

    So I guess the million dollar question is:
    What sets/triggers the updating of "Ccd Managed Data" in AddressableAssetSettings object?
     
    Last edited: Oct 26, 2023
    KingKRoecks likes this.
  13. sampenguin

    sampenguin

    Joined:
    Feb 1, 2011
    Posts:
    64
    Here's the response I got from Unity Support, which doesn't exactly clear things up (and if I have to set these IDs at runtime then am I not "shipping references to dev and staging environments"???) but provided for everyone's information:

    __________________
    Hi,

    Thank you for submitting the issue.

    After looking into your issue and reading the forum thread, I would like to give you some explanations. Firstly, Automatic by default creates a bucket based on your build target. So it will create something like Windows64 or Android as your bucket name and then use that. It will use the "latest" badge.

    Then, when you're building a production build, you'd switch to the "Production" profile, and all the CcdManager values would be set correctly and work by default. But it will not work by default for other environments like “Development“ or “Staging“. The editor doesn't save all the profile information during the build because our team doesn't want to ship games with references to people's development and staging environments, so this doesn't look at values from the profiles dynamically. As a workaround, you can manually set the needed values for Environment, BucketId, and Badge in runtime.

    I found out that you are trying to set the environment for CCD by code:


    var options = new InitializationOptions(); options.SetEnvironmentName(environmentUGS.ToString()); await UnityServices.InitializeAsync(options);
    Instead of that, you must set these values in CcdManager before any Addressables call like in the example here: Addressable Asset system with Cloud Content Delivery | Addressables | 1.20.5

    That said, if you have further questions, please feel free to contact us.
    __________________

    So I guess what I'm understanding from this is ultimately you have to roll your own method of specifying the CcdManager variables at runtime and the Unity system that implies it does that is basically not doing that.
     
    kdchabuk likes this.