DllNotFoundException: HavokNative assembly in 0.51.0

Hi,

I've just upgraded to Entities / Physics / Havok 0.51.0 p.32 from 0.50.1 p.2 , at the same time updating the editor to 2021.3.4 from 2020.3.35. I made all the essential physics code changes in 0.50, so haven't made any since. However on entering play mode, I get this error in the console:

DllNotFoundException: HavokNative assembly:<unknown assembly> type:<unknown type> member:(null)
Havok.Physics.Plugin.EnsureUnlocked () (at Library/PackageCache/com.havok.physics@0.51.0-preview.32/Havok.Physics/HavokPlugin.cs:190)
Havok.Physics.SimulationContext..ctor (Havok.Physics.HavokConfiguration config) (at Library/PackageCache/com.havok.physics@0.51.0-preview.32/Havok.Physics/HavokSimulation.cs:68)
Havok.Physics.HavokSimulation..ctor (Havok.Physics.HavokConfiguration config) (at Library/PackageCache/com.havok.physics@0.51.0-preview.32/Havok.Physics/HavokSimulation.cs:252)
Havok.Physics.RegisterHavok.<__OnUpdate_7F59F39>b__1_0 (System.UInt32 physicsWorldIndex) (at Library/PackageCache/com.havok.physics@0.51.0-preview.32/Havok.Physics/HavokSimulation.cs:30)
Unity.Physics.Systems.PhysicsWorldStepper.ScheduleSimulationStepJobs (Unity.Physics.SimulationType simType, System.UInt32 physicsWorldIndex, Unity.Physics.SimulationStepInput& stepInput, Unity.Jobs.JobHandle& inputDep, System.Boolean multiThreaded) (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/ECS/Base/Systems/PhysicsWorldStepper.cs:95)
Unity.Physics.Systems.StepPhysicsWorld.OnUpdate () (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/ECS/Base/Systems/StepPhysicsWorld.cs:87)
Unity.Entities.SystemBase.Update () (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/SystemBase.cs:409)
Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:583)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:588)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:529)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ScriptBehaviourUpdateOrder.cs:426)

..Followed by this printing every frame:

ObjectDisposedException: The Unity.Collections.NativeArray`1[System.UInt16] has been deallocated, it is not allowed to access it
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <73aec3f4342e41c48454378e5e0395dd>:0)
Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& safety, Unity.Collections.LowLevel.Unsafe.DisposeSentinel& sentinel) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/DisposeSentinel.cs:78)
Unity.Collections.NativeArray`1[T].Dispose () (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:190)
Unity.Physics.DispatchPairSequencer+BitLookupTableDynamicDynamicPairs.Dispose () (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/Dynamics/Simulation/Scheduler.cs:407)
Unity.Physics.DispatchPairSequencer.Dispose () (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/Dynamics/Simulation/Scheduler.cs:248)
Unity.Physics.Simulation.Dispose () (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/Dynamics/Simulation/Simulation.cs:222)
Unity.Physics.Systems.PhysicsWorldStepper.ScheduleSimulationStepJobs (Unity.Physics.SimulationType simType, System.UInt32 physicsWorldIndex, Unity.Physics.SimulationStepInput& stepInput, Unity.Jobs.JobHandle& inputDep, System.Boolean multiThreaded) (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/ECS/Base/Systems/PhysicsWorldStepper.cs:94)
Unity.Physics.Systems.StepPhysicsWorld.OnUpdate () (at Library/PackageCache/com.unity.physics@0.51.0-preview.32/Unity.Physics/ECS/Base/Systems/StepPhysicsWorld.cs:87)
Unity.Entities.SystemBase.Update () (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/SystemBase.cs:409)
Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:583)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:588)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:529)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:583)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystemGroup.cs:523)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ComponentSystem.cs:114)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/ScriptBehaviourUpdateOrder.cs:426)

I've tried clearing the library and caches etc but it doesn't help.

Also get this error in the player log when I run a standalone, along with a bunch of nullrefs to do with Unity.Physics.Systems.BuildPhysicsWorld. The standalone crashes after a couple of frames.

ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl`1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc' for which no ahead of time (AOT) code was generated.
  at Unity.Entities.FastEquality.Equals[T] (T& lhs, T& rhs, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.TypeManager.Equals[T] (T& left, T& right) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.ManagedComponentStore.FindSharedComponentIndex[T] (System.Int32 typeIndex, T newData) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.ManagedComponentStore.InsertSharedComponent_Managed[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.EntityDataAccess.InsertSharedComponent[T] (T newData) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.EntityQueryImpl.AddSharedComponentFilter[SharedComponent] (SharedComponent sharedComponent) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Physics.Systems.PhysicsWorldData..ctor (Unity.Entities.EntityManager EntityManager, Unity.Physics.PhysicsWorldIndex& worldIndex) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Physics.Systems.BuildPhysicsWorld.OnCreate () [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.ComponentSystemBase.CreateInstance (Unity.Entities.World world, Unity.Entities.SystemState* statePtr) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.World.AddSystem_OnCreate_Internal (Unity.Entities.ComponentSystemBase system) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.World.GetOrCreateSystemsAndLogException (System.Collections.Generic.IEnumerable`1[T] types, System.Int32 typesCount) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.DefaultWorldInitialization.AddSystemToRootLevelSystemGroupsInternal[T] (Unity.Entities.World world, System.Collections.Generic.IEnumerable`1[T] systemTypesOrig, Unity.Entities.ComponentSystemGroup defaultGroup, T rootGroups) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.DefaultWorldInitialization.AddSystemToRootLevelSystemGroupsInternal (Unity.Entities.World world, System.Collections.Generic.IEnumerable`1[T] systemTypesOrig) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x00000] in <00000000000000000000000000000000>:0
Unity.Entities.World:GetOrCreateSystemsAndLogException(IEnumerable`1, Int32)
Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, ComponentSystemGroup, T)
Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1)
Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
Unity.Entities.AutomaticWorldBootstrap:Initialize()

I tried the fix here and can now run the standalone build fine, however the editor still suffers from the first two errors. If it's relevant, I'm on the 2021.3.4 Silicon editor.