Error building a HoloLens project

While building for the HoloLens (using the dev-vr-hololens2 branch) I got this following error mentioning xgConsole.exe. Anyone know what is causing the error?

UATHelper: Packaging (HoloLens): Took 4.0095401s to run xgConsole.exe, ExitCode=1
UATHelper: Packaging (HoloLens): ERROR: Command failed (Result:1): C:\Program Files (x86)\IncrediBuild\xgConsole.exe "C:\Martin\Unreal\UEH\Engine\Programs\AutomationTool\Saved\Logs\UAT_XGE.xml" /Rebuild /NoLogo /ShowAgent /ShowTime /no_watchdog_thread. See logfile for details: 'xgConsole-2019.06.07-10.19.45.txt' 
UATHelper: Packaging (HoloLens):        (see C:\Martin\Unreal\UEH\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
PackagingResults: Error: Command failed (Result:1): C:\Program Files (x86)\IncrediBuild\xgConsole.exe "C:\Martin\Unreal\UEH\Engine\Programs\AutomationTool\Saved\Logs\UAT_XGE.xml" /Rebuild /NoLogo /ShowAgent /ShowTime /no_watchdog_thread. See logfile for details: 'xgConsole-2019.06.07-10.19.45.txt' 
UATHelper: Packaging (HoloLens): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (HoloLens): BUILD FAILED
PackagingResults: Error: Unknown Error

Ouch. This is bug of current incompatibility with InreadiBuild. It would be fixed in the future, but today there is a workaround.

Engine\Source\Programs\UnrealBuildTool\Platform\HoloLens\UEBuildHoloLens.cs

in HoloLens add the following method

    public override bool CanUseXGE()
    {
        return false;
    }

Thanks for the response, I assumed the same so I tried to uninstall inreadiBuild, but still got the error about automationTool. When I added the method you gave me, I got a new error:

UATHelper: Packaging (HoloLens): RunUAT.bat ERROR: AutomationTool failed to compile.
PackagingResults: Error: AutomationTool failed to compile.
UATHelper: Packaging (HoloLens): BUILD FAILED
PackagingResults: Error: Unknown Error

To be honest, I am not deeply in IncreadiBuild staff, but as I know its usage might require full rebuild of the Unreal. My code blocks it just for HoloLens.

As I understood I don’t need IncreadiBuild so I am trying without it, doing some rebuilds and trying some solutions I found on the AutomationTool error.

After reporting the error to epic, I got the following answer:
“Thank you for your information and time. After doing some digging I was able to find that there was an issue with the Interop dll in the HoloLens 2 stream on GitHub. We just copied Dev-VR to Main just this morning, so you should be able use the mainline UE4 stream, (or Dev-VR stream) on GitHub. I hope that this information helps.”

They have fixed the error and It now works when I just download the dev-vr branch, no point in using the dev-vr-hololens2 branch.