Trying to build 4.22 from in Visual Studio 2019 but getting an error on build

Hello!
Trying to build 4.22 for magic leap development but cannot seem to get the engine to build, i did the following:

1-Cloned ‘Unreal Engine’ onto the D Drive
2-Ran Setup.BAT
3-Ran Generate Project Files.BAT (it asked me to overwrite some files i said Y)
4-Opened The Solution in VS and right clicked on UE4 and pressed BUILD

It runs for a while and i get an error towards the end

Severity Code Description Project File Line Suppression State
Error MSB3075 The command “…..\Build\BatchFiles\Build.bat -Target=“ShaderCompileWorker Win64 Development” -Target=“UE4Editor Win64 Development” -WaitMutex -FromMsBuild” exited with code 5. Please verify that you have sufficient rights to run this command. UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 44

Severity Code Description Project File Line Suppression State
Error C4800 Implicit conversion from ‘void *’ to bool. Possible information loss UE4 D:\UnrealEngine\Engine\Plugins\Lumin\MagicLeap\Source\MagicLeap\Private\MagicLeapSDKDetection.cpp 13

Any ideas how to fix this ? Ive tried opening VS as an admin also but no to no joy.

Thank you

Did you solve this ? I am having the same issue

thanks

This problem can’t be solved without fixing the code in:
D:\UnrealEngine\Engine\Plugins\Lumin\MagicLeap\Source\MagicLeap\Private\MagicLeapSDKDetection.cpp line 13

it’s a code error not misconfigured build.
Note that 4.22 was built with VS 2017, you may try to install older toolchain into VS2019 and try to compile.