Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Invalid URI: Invalid port specified after updating a build.

Discussion in 'Addressables' started by MaxwellLovellWPS, Jan 4, 2023.

  1. MaxwellLovellWPS

    MaxwellLovellWPS

    Joined:
    Jan 4, 2023
    Posts:
    9
    Hello,
    My team and I are having issues getting addressable to properly load in changes for editor and builds. Currently, when entering play mode, loading, and instantiating an asset it produces an error I will paste below. Here is the code block for the section where are instantiating the game object.

    await Addressables.InitializeAsync();
    await Addressables.CheckForCatalogUpdates();

    sceneComposer.InstantiateAsync(transform.parent, false);


    We are using CCD and accessing the bucket through CCD.dev.OurBucketName.latest remote path. Here is a link to an album containing relevant settings https://imgur.com/a/ewiq613

    This is on Addressables 1.20.5, Unity 2022.1.2f1

    Steps causing error:
    1. Create new addressable build.
    2. Upload bundles and catalog files to the target bucket through the dashboard
    3. Test using "Use existing build"
    4. Loads successfully or port error.
    5. Make change to one of the addressable prefabs, i.e. adding a sphere
    6. Either making new build or updating a previous build (both have same results)
    7. Uploading changed bundles and catalog files to the target bucket through the dashboard
    8. Always port error.

    Thank you. I will post error and relevant scripts below.
     
  2. MaxwellLovellWPS

    MaxwellLovellWPS

    Joined:
    Jan 4, 2023
    Posts:
    9
  3. MaxwellLovellWPS

    MaxwellLovellWPS

    Joined:
    Jan 4, 2023
    Posts:
    9
    Relevant code:

    Code (CSharp):
    1. [SerializeField] List<string> addressablesToLoad = new List<string>();
    2.     [SerializeField] List<string> prefabsToInstantiate = new List<string>();
    3.  
    4.     // Start is called before the first frame update
    5.     IEnumerator Start()
    6.     {
    7.         Logger.Log("Starting scene composition");
    8.  
    9.         long totalSize = 0;
    10.         foreach (string key in addressablesToLoad)
    11.         {
    12.             AsyncOperationHandle<long> getDownloadSize = Addressables.GetDownloadSizeAsync(key);
    13.             yield return getDownloadSize;
    14.             totalSize += getDownloadSize.Result;
    15.         }
    16.  
    17.         long sizeFinished = 0;
    18.         AsyncOperationHandle downloadHandle;
    19.         foreach (string key in addressablesToLoad)
    20.         {
    21.             AsyncOperationHandle<long> getDownloadSize = Addressables.GetDownloadSizeAsync(key);
    22.             yield return getDownloadSize;
    23.  
    24.             if (getDownloadSize.Result > 0)
    25.             {
    26.                 downloadHandle = Addressables.DownloadDependenciesAsync(key, false);
    27.                 float progress = 0;
    28.  
    29.                 while (downloadHandle.Status == AsyncOperationStatus.None)
    30.                 {
    31.                     float percentageComplete = downloadHandle.GetDownloadStatus().Percent;
    32.                     if (percentageComplete > progress * 1.1) // Report at most every 10% or so
    33.                     {
    34.                         progress = percentageComplete; // More accurate %
    35.                         LoadingEvent loadingEvent = GameEventFactory.Create<LoadingEvent>();
    36.                         loadingEvent.EventType = LoadingEventType.Progress;
    37.                         loadingEvent.PercentProgress = (progress * getDownloadSize.Result + sizeFinished) / (float)totalSize;
    38.                         loadingEvent.Message = "Downloading " + key;
    39.                         loadingEvent.Publish();
    40.                     }
    41.  
    42.                     yield return null;
    43.                 }
    44.  
    45.                 Addressables.Release(downloadHandle);
    46.                 sizeFinished += getDownloadSize.Result;
    47.             }
    48.         }
    49.  
    50.         AsyncOperationHandle<IList<GameObject>> loadHandle;
    51.         loadHandle = Addressables.LoadAssetsAsync<GameObject>(prefabsToInstantiate,
    52.             addressable =>
    53.             {
    54.                 //Gets called for every loaded asset
    55.                 Instantiate<GameObject>(addressable, transform.parent);
    56.             }, Addressables.MergeMode.Union);
    57.  
    58.         while (loadHandle.Status == AsyncOperationStatus.None)
    59.         {
    60.             yield return null;
    61.         }
    62.  
    63.         LoadingEvent finishedEvent = GameEventFactory.Create<LoadingEvent>();
    64.         finishedEvent.EventType = LoadingEventType.Finished;
    65.         finishedEvent.Publish();
    66.  
    67.         Logger.Log("Finished scene composition");
    68.     }
     
  4. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @unity_E76D7AFE64EFDB7A3A97 does the issue reproduce in 1.21.2? I recall there were some issues with the CCD integration in 1.20.5
     
    MaxwellLovellWPS likes this.
  5. MaxwellLovellWPS

    MaxwellLovellWPS

    Joined:
    Jan 4, 2023
    Posts:
    9
    Thanks Pilla, didn't think of testing that.
    Just tried with 1.21.2, doing one addressable build worked but updating and uploading the updated content failed with the same error. Attempting to do a new default build also lead to the same error. Think we will stick with 1.21.1 for now since it looks a little bit nicer anyways
     
  6. MaxwellLovellWPS

    MaxwellLovellWPS

    Joined:
    Jan 4, 2023
    Posts:
    9
    Bumping this, so far no luck still