'Unity Error: "Native error = The system can not find the stated file."

I created a Unity app with MRTK and try to build the Appx file with the MRTK build window. But when I press the "Build Appx" butten I get this error

Win32Exception: ApplicationName='cmd.exe', CommandLine='/C vswhere -all -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe -latest', CurrentDirectory='C:\Program Files (x86)\Microsoft Visual Studio\Installer', Native error= The system can not find the stated file.

The error may come from the fact that some Windows system variables are missing in the advanced system settings under the PATH variable, but I'm not entirely sure. I've already tried uninstalling Visual Studio and Unity but it didn't work.

Has anyone experienced this error?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source