facebook twitter hatena line email

Unity/CloudBuild

提供: 初心者エンジニアの簡易メモ
2021年8月1日 (日) 02:02時点におけるAdmin (トーク | 投稿記録)による版 (Build Remote Catalogのエラーが出るとき)

移動: 案内検索

CloudBuildをOnへ

window/General/Services/CloudBuildをonへ

CloudBuildが使えるプランか確認

UnityTeasmAdvantedが必要なので、以下リンク先から確認

Unity/UnityTeams [ショートカット]

CloudBuild使えることを確認

  1. https://dashboard.unity3d.com/
  2. CloudBuild選択
  3. 連携してるUnityプロジェクト選択
  4. Configを開き
  5. "EDIT SOURCE CONTROL"のリンクが有効であることを確認

git連携

  1. https://dashboard.unity3d.com/
  2. CloudBuild選択
  3. 連携してるUnityプロジェクト選択
  4. Configを開き
  5. "EDIT SOURCE CONTROL"のリンクをクリック
  6. リポジトリ選択(githubとか選択してgitのプロジェクトを選択)

プラットフォーム選択

  1. Configを開き
  2. "SETUP NEW TARGET"ボタンを押して、プラットフォーム(WebGLとか)選択

Androidプラットフォームについて

  1. BundleIdを入力(com.example.~)
  2. keystoreのファイルをupload

iOSプラットフォームについて

  1. BundleIdを入力(com.example.~)
  2. プロビジョニング プロファイルをupload
  3. p12 ファイルをupload

CloudBuild実行

  1. historyからBuildボタンを押す

add a sceneエラーが出るとき

以下エラーがでるとき

There were no scenes configured to build! Please add a scene to the build using the Build Settings window of the Unity Editor.

Unityのメインメニュー/BuildSetting/SceneInBuildにAddOpenSceneを、クリックしてシーンを追加する

unavailableエラーがでるとき

loading logs; logs unavailable for this project & build.

暫く待つと治り、勝手にBuildが始まる。

WebGLプラットフォームについて

Asset Bundleビルド

  1. ConfigのAsset Bundle Optionsを選択
  2. "Yes, I'd like to build Asset Bundles"にチェックを入れ
  3. Bundles Base Pathにpathを入れる

自動ビルド

コミットすると自動でAsset Bundleビルドを開始するように

  1. ConfigのBasicのAuto-Buildをonへ

Addressable Asset ビルド

  1. ConfigのAddressable Asset Optionsを選択
  2. "Yes, I'd like to build Addressable Assets"にチェックを入れる
  3. "Content Update Build"の項目にチェックを入れる。
  4. "Content State Location Method"に"Use a content State file produced from another build target"
  5. "Linked Build Target" を"Default WebGL"へ

2019/8ぐらいから CloudBuildにAddressablesが追加されたっぽい。

参考:https://qiita.com/yakimeron/items/821e101307e69c8eddaf

addressables_content_state.binを使ってビルド

Assets/AddressableAssetsData/WebGL/addressables_content_state.binにファイルが有るか確認。

  1. "Content State Location Method"に"Use a content State file from Source Control"を選択し
  2. Path to Content State Fileに"Assets/AddressableAssetsData/WebGL/addressables_content_state.bin"を入れてるとなる。

以下エラーになった場合

[Unity] Error Building Addressables: Could not find a part of the path "/BUILD_PATH/new-unity-project-1.default-webgl/Assets/AddressableAssetsData/WebGL/addressables_content_state.bin".

.gitignoreに以下のようなものが入ってないか確認。入っていれば削除して、binファイルをgitに含める。

# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

default-webglが無いと出るとき

以下エラーになった場合

1: Error: Could not find Content State File for Linked Build Target "default-webgl". Please ensure at least one addressables build has completed successfully for that target.

ProfileにDefault以外が選択されてないか確認して、Default以外が選択されていれば、それを、CloudBuildのAddressableAssetOptionsのProfile Nameに入れる。

ProfileNameを入れても、同じエラーになった場合は、

default-webglに設定されている、BuildPathやLoadPathがあるか確認する。

Build Remote Catalogのエラーが出るとき

以下エラーが出るとき

[Unity] ERROR: Previous build had 'Build Remote Catalog' disabled.  You cannot update a player that has no remote catalog specified
  1. Assets/AddressableAssetSettingのBuildRemoteCatalogをonへ
  2. 新たに表示される、以下を項目をnullから以下へ設定する。
  3. Build Path を RemoteBuildPath へ
  4. Load Path を RemoteLoadPath へ
  5. Addressableのcacheを消し、Addressableを再ビルドするとcatalogがServerData/WebGLの下にできる
  6. RemoteLoadPathのurlにServerData/WebGLの下にあるbundleとcatalogファイルをup

参考:https://qiita.com/tetr4lab/items/1b26755089820b041b4f

BuildPlayerContentが見つからないエラーが出るとき

以下エラーがでるとき

Building Addressables: ERROR: Could not find BuildPlayerContent in Addressable Assets assembly.

Config/AddressablesBuildのチェックを外す

参考

https://www.fast-system.jp/unity-cloud-build-howto/