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.

BuildAssetBundles hangs Compiling compute variants

Discussion in 'Addressables' started by Arcanor, Oct 20, 2021.

  1. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I'm doing what I expect to be a very simple assetbundle build script, but when I run it, it never finishes, even after hours of waiting. Anyone seen this?

    One important detail: it only seems to happen when targeting BuildTarget.WebGL.

    Unity_IA9wKu4uj4.png
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using System.IO;
    4. using UnityEditor;
    5. using UnityEngine;
    6.  
    7. public class CreateAssetBundles
    8. {
    9.     [MenuItem("Assets/Build AssetBundles")]
    10.     private static void BuildAllAssetBundles()
    11.     {
    12.         string bundleFolder = "Assets/AssetBundles";
    13.         if (!Directory.Exists(bundleFolder))
    14.         {
    15.             Directory.CreateDirectory(bundleFolder);
    16.         }
    17.  
    18.         BuildPipeline.BuildAssetBundles(bundleFolder, BuildAssetBundleOptions.None, BuildTarget.WebGL);
    19.     }
    20. }
    21.  
    The assetbundle build never completes, and can't be stopped without exiting the editor completely. Notably, the assetbundles themselves do appear to build correctly, even though the build process continues.

    I've tried updating my video driver, rebooting the whole machine multiple times, deleting the entire Library folder, etc.

    For the record, I'm on Windows 10, with Unity 2020.3.20f1 LTS.
     
    Last edited: Oct 20, 2021
  2. SaulChow

    SaulChow

    Joined:
    Mar 23, 2021
    Posts:
    10
    I got the same issue today and finally figured it out.

    Did you install Cinemachine 2.6.11 package?

    I removed Cinemachine and then the issue had been gone.
    But I don't know why.

    And then I re-installed Cinemachine 2.8.4. But this time assetbundles built normally.

    I think may be some Cinemachine versions or some packages cause this issue.
     
  3. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    yes, I think I had cinemachine installed. I'm not working on that project right now though, so I can't check.