Search Unity

Build Addressable Profile During a Unity Cloud Build

Discussion in 'Addressables' started by lfg_ryan, Jul 24, 2019.

  1. lfg_ryan

    lfg_ryan

    Joined:
    May 8, 2019
    Posts:
    7
    I am not really sure where to start in regards to getting addressables and Unity Cloud Build to work together.

    Current State
    • I can make and run local iOS builds with Addressables using a manual click of the Build Player Content menu option before doing the iOS build
    • I can have a Unity Cloud Build setup that can make iOS builds that do not include the addressable assets (because I do not commit the cooked StreamingAssets to my repo I assume).
    Goal
    • Have Unity Cloud Build build the addressable content for a "Production" profile before doing the build.
    Constraint
    • I would like to not have to commit any local build artifacts to my Repo (ie. Generation fo the StreamingAssets folder)
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
  3. lfg_ryan

    lfg_ryan

    Joined:
    May 8, 2019
    Posts:
    7
    This worked great and resolved my issue. Thank you!
     
  4. Konstantin_Playtino

    Konstantin_Playtino

    Joined:
    May 2, 2019
    Posts:
    7
    Hi, I am using the same code to build the assets but I get following error. This only happens during cloud build, local build is fine. Some ideas?
     

    Attached Files:

  5. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Hi @Konstantin_Playtino, a good percentage of cloud build issue are missing files. I guess you may forget to commit a file or that file is ignored by git (via .gitignore).

    From the log, the CloudBuildHelper.PreExport method is executed and failed at AddressableAssetEntry.CreateCatalogEntries()

    Code (CSharp):
    1.         public void CreateCatalogEntries(List<ContentCatalogDataEntry> entries, bool isBundled, string providerType, IEnumerable<object> deps, object extraData)
    2.         {
    3.             var assetPath = GetAssetLoadPath(isBundled);
    4.             var keyList = CreateKeyList();
    5.             var mainType = AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
    6.          
    7.             if (mainType == typeof(SceneAsset))
    8.                 mainType = typeof(SceneInstance);
    9.  
    10.             if (!CheckForEditorAssembly(ref mainType, assetPath))
    11.                 return;
    The mainType seems null, caused by a non-existing AssetPath.
     
  6. Konstantin_Playtino

    Konstantin_Playtino

    Joined:
    May 2, 2019
    Posts:
    7
    Hi @Favo-Yang, I actually know this type of error and I also checked my files. Like I said the local build runs without the issue. I downgraded Addressables to 1.1.4 and now cloud build works again. I don't know why but thanks for your response.
     
  7. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Hi @Konstantin_Playtino, would you mind submit a ticket [Cloud build > Support > OPEN A TICKET]. It sounds a bug.