As of 24-Mar-2022, with UE5 Preview 2 installed from the Epic Games launcher to a non-default location (D:\Dev\UE_5.0), this is still a problem.
I was able to fix this, see below for details.
To restate the issue: When trying to clean my project, I was getting an unhelpful error saying something about Error_UBTMissing. It was impossible to clean or rebuild from my code editor. (Using Rider early access in case it matters).
I tracked down the issue to a bug in Engine/Build/BatchFiles/Clean.bat
There is a line there that specifically affects installed builds of UE5 differently than compiled builds. Apparently its intent is to prevent the rebuilding of UE5 itself during the clean(?)
In any case, the goto ReadyToClean statement caused the set UBTPath=... to never be executed and so UBTPath was an undefined variable. Perhaps this is OK when UE5 is installed into the default location(?), but it definitely does NOT work if UE5 is installed to a custom location.
To fix the error, I simply moved this line:
set UBTPath="..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll"
above this line:
if exist ..\Build\InstalledBuild.txt goto ReadyToClean
After saving Engine/Build/BatchFiles/Clean.bat with the new appropriately assigned UBTPath variable, Clean and Rebuild are now working as expected.
I still wonder where the error message about âError_UBTMissingâ comes from. As if the buggy clean.bat script tried to execute Error_UBTMissing where it really is just a goto label.
My guess is that deeper in the build process there is a default value for UBTPath, the default install location. Wherever that is, that is what is creating the Error_UBTMissing error message which coincidentally (perhaps intentionally?) mirrors the name of the goto in Clean.bat.
Anyway, easy fix here, hopefully someone commits this before the next preview release, as currently it is 100% broken for non-default location installs, at the very least.
I spend about half a day fighting this bug. This is of course also due to my lack of experience with UE. But once clean didnât work anymore (without me noticing), my changes in that one cpp-file were not reflected in the engine anymore. Naturally, I didnât realize that, either. Instead I added log statement of all kinds and got frustrated that no log would show up and so on and so forth. Thanks for that fix!
Another possibility: if you have this environment variable set on windows ( MSBuildSDKsPath
C:\Program Files\dotnet\sdk\3.1.201\Sdks ) , remove it, reboot.
Struggling with this problem right now. the unreal build tool .exe doesnât exist in my installation at all. I have searched and searched for it, even in the Epic Games folder under Programs. I too have installed this not on the C drive, so that is why I am suffering from these problems. I cannot run any of the commands listed in these posts because the exe simply isnât there for me to run them off of. I also tried to look at the clean.bat file, but it is very short and didnât have a PBT path as described.
This all occurred after I tried to add an Actor Interface C++ class from within Unreal Engine while I had errors in my code. When it tried to do Live Reload coding, the build failed obviously. Then I began to notice changes to my cpp files not updating when I ran things in Unreal. I cleaned the project and the solution and it was all messed up from that point forward. Canât even get into my project any more.
I canât rebuild the solution files either, as it relies upon the exe, which I am missing.
My only resort at this point is to create a new project.
Edit: I found âD:\UnrealEngine\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.slnâ, booted that up, built the project, and luckily it did make the exe that I was missing. I still canât imagine why I wouldnât have it to begin with because I just installed Unreal like a week ago. I ran one of the cmd commands from above posts, rebuilt the solution by right-clicking the project, rebuilt from within Visual Studio, and now am finally back to normal. Holy smokes this was a nightmare.
Another possible solution is to verify the engine using the Epic Store app and redownload those files.
In my case, the missing UnrealBuildTool.* and related configs were downloaded and sln project generation began to work.