Can't find AvatarDynamicsSetup

There was an error when importing assets today, and after restarting it turned out like this, seems like it couldn’t find the script。

These are some codes from the error interface, can someone help me see where the error is?

using System;
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using JetBrains.Annotations;
using UnityEngine.Animations;
using VRC.Core.Pool;
using VRC.SDK3.Avatars.Components;
using VRC.SDK3.Dynamics.PhysBone;
using VRC.Dynamics;
using VRC.SDK3.Dynamics;
using VRC.SDKBase.Validation;
using Object = UnityEngine.Object;

namespace VRC.SDK3.Avatars
{
///
/// Avatar specific VRC dynamics setup.
///
public static class AvatarDynamicsSetup
{
[InitializeOnLoadMethod]
private static void EditorInit()
{
DynamicsComponent.DefaultUsage = DynamicsUsage.Avatar;
}

    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    private static void RuntimeInitInitializeEvents()
    {
        //Contacts
        ContactBase.OnInitialize = Contact_OnInitialize;

        //PhysBones
        VRCPhysBoneBase.OnInitialize = PhysBone_OnInitialize;
        VRCPhysBoneColliderBase.OnPreShapeInitialize += PhysBoneCollider_OnPreShapeInitialize;

        //Raycasts (not really part of dynamics, but they still need animator parameters)
        VRCRaycast.OnInitializeParameters = VRCRaycast_OnInitialize;
    }

    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
    private static void RuntimeInitPhysBoneGrabHelper()
    {
        // PhysBoneManager singleton should exist following DynamicsSetup.
        PhysBoneManager.Inst.gameObject.AddComponent<PhysBoneGrabHelper>();
    }


    private static bool Contact_OnInitialize(ContactBase contact)
    {
        contact.Usage = DynamicsUsage.Avatar;
        var avatarDesc = contact.GetComponentInParent<VRCAvatarDescriptor>();

        if (avatarDesc != null)
        {
            // Emulate different players for editor testing with multiple avatars in the same scene. Required by Allow Self and Allow Others.
            contact.playerId = avatarDesc.GetHashCode();

            var receiver = contact as ContactReceiver;
            if (receiver != null && !string.IsNullOrWhiteSpace(receiver.parameter))
            {
                var animator = avatarDesc.GetComponent<Animator>();
                if (animator != null)
                {
                    // called from SDK, so create SDK Param access
                    receiver.paramAccess = new AnimParameterAccessAvatarSDK(animator, receiver.parameter);
                }
            }
        }

        return true;
    }

    private static void PhysBone_OnInitialize(VRCPhysBoneBase physBone)
    {
        physBone.Usage = DynamicsUsage.Avatar;

        var avatarDesc = physBone.GetComponentInParent<VRCAvatarDescriptor>();
        if (avatarDesc != null)
        {
            // Emulate different players for editor testing with multiple avatars in the same scene. Required by Allow Self and Allow Others.
            physBone.playerId = avatarDesc.GetHashCode();

            if (!string.IsNullOrEmpty(physBone.parameter))
            {
                var animator = avatarDesc.GetComponent<Animator>();
                if (animator != null)
                {
                    physBone.param_IsGrabbed = new AnimParameterAccessAvatarSDK(animator, physBone.parameter + VRCPhysBoneBase.PARAM_ISGRABBED);
                    physBone.param_IsPosed = new AnimParameterAccessAvatarSDK(animator, physBone.parameter + VRCPhysBoneBase.PARAM_ISPOSED);
                    physBone.param_Angle = new AnimParameterAccessAvatarSDK(animator, physBone.parameter + VRCPhysBoneBase.PARAM_ANGLE);
                    physBone.param_Stretch = new AnimParameterAccessAvatarSDK(animator, physBone.parameter + VRCPhysBoneBase.PARAM_STRETCH);
                    physBone.param_Squish = new AnimParameterAccessAvatarSDK(animator, physBone.parameter + VRCPhysBoneBase.PARAM_SQUISH);
                }
            }
        }
    }

    private static void VRCRaycast_OnInitialize(VRCRaycast raycast)
    {
        if (!string.IsNullOrEmpty(raycast.Parameter))
        {
            var avatarDesc = raycast.GetComponentInParent<VRCAvatarDescriptor>();
            if (avatarDesc != null)
            {
                var animator = avatarDesc.GetComponent<Animator>();
                if (animator != null)
                {
                    raycast.param_Hit = new AnimParameterAccessAvatarSDK(animator, raycast.Parameter + VRCRaycast.PARAM_HIT);
                    raycast.param_Ratio = new AnimParameterAccessAvatarSDK(animator, raycast.Parameter + VRCRaycast.PARAM_RATIO);
                    raycast.param_Distance = new AnimParameterAccessAvatarSDK(animator, raycast.Parameter + VRCRaycast.PARAM_DISTANCE);
                }
            }
        }
    }

    private static void PhysBoneCollider_OnPreShapeInitialize(VRCPhysBoneColliderBase physBoneCollider)
    {
        physBoneCollider.Usage = DynamicsUsage.Avatar;

        var avatarDesc = physBoneCollider.GetComponentInParent<VRCAvatarDescriptor>();
        if (avatarDesc != null)
        {
            // Emulate different players for editor testing with multiple avatars in the same scene. Required by Allow Self and Allow Others.
            physBoneCollider.playerId = avatarDesc.GetHashCode();
        }
    }

    #region PhysBone Conversion
    [MenuItem("VRChat SDK/Utilities/Convert DynamicBones To PhysBones")]
    public static void ConvertSelectedToPhysBones()
    {
        List<GameObject> avatarObjs = new List<GameObject>();
        foreach (var obj in Selection.objects)
        {
            var gameObj = obj as GameObject;
            if (gameObj == null)
                continue;

            var descriptor = gameObj.GetComponent<VRCAvatarDescriptor>();
            if (descriptor != null)
            {
                avatarObjs.Add(gameObj);
            }
        }
        if (avatarObjs.Count == 0)
        {
            EditorUtility.DisplayDialog("Warning", "No avatars found.  Please select an avatar in the hierarchy window before using this feature.", "Okay");
        }
        else
        {
            ConvertDynamicBonesToPhysBones(avatarObjs);
        }
    }
    public static void ConvertDynamicBonesToPhysBones(IEnumerable<GameObject> avatarGameObjects)
    {
        if (!EditorUtility.DisplayDialog("Warning", "This operation will remove all DynamicBone components and replace them with PhysBone components on your avatar. This process attempts to match settings but the result may not app...

<…etc…>

Your Unity Editor is in Safe Mode, which means the scripts such as VRChat Avatar SDK were not loaded.

Maybe an unitypackage you imported included older versions of shaders such as Poiyomi Toon or lilToon, and it overwrote whatever you had imported via VRChat Creator Companion or ALCOM. Remove those scripts and re-import what you actually need.

You should look at the first warning message on there, also did you add a bunch of stuff before opening the project for the first time?

Specific example, not your specific example though: add av3emulator and gesture manager to a fresh project, then open it. Hello safe mode. Having both gave a nice expression wheel in play mode, but not really necessary.

After opening the project for the first time, I added a lot of stuff, but strangely, when I imported the same assets into a new project, it actually ran. Does this count as fixed?

It probably isn’t a shader issue. After importing the assets into a new project, I found that some assets had UdonSharp imported, which caused compilation errors in my project. After deleting this script, it ran fine, but the problem with the old project is still unresolved.

As for those yellow warnings, they’re actually fine, I sorted them out after reopening safe mode.