#NullReference when trying to build asset bundle

1 messages · Page 1 of 1 (latest)

hushed crag
#

Version is 6000.0.36f1.

Trying to build an asset bundle that includes a Shadergraph and some textures. Getting a null reference in UnityEngine.Rendering.Universal.ScreenSpaceAmbientOcclusion.AddRenderPasses.

#

This happens in both a new 3D URP project, and the unity URP example.

#

Unity also stops rendering anything in the scene window after this happens.

#

Until the asset bundle is built, rendering works fine

#

.unitypackage includes the assets

#

asset bundles are built using the editor script:

using UnityEditor;
using System.IO;

public class CreateAssetBundles
{
    [MenuItem("Assets/Build AssetBundles")]
    static void BuildAllAssetBundles()
    {
        string assetBundleDirectory = "Assets/AssetBundles";
        if (!Directory.Exists(assetBundleDirectory))
        {
            Directory.CreateDirectory(assetBundleDirectory);
        }
        BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
    }
}