Unable to Generate Project Files

have you tried to rerun Setup.bat?

I’m receiving a strange error when trying to run GenerateProjectFiles.bat

Setting up Unreal Engine 4 project files...
ERROR: Visual Studio 2019 (14.22.27905) must be installed in order to build this target.

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.

Press any key to continue . . .

I’ve tried searching around the internet for some answers to no avail. I’m running out of patience for this issue. I’ve already checked BuildConfiguration.xml, and I can confirm that I have VS 2019 installed. In fact I updated it today before I started compiling 4.22 with absolutely not a single issue. This is the first time I’ve had an issue with the engine where there were no information available to help me.

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <CompilerVersion>14.22.27905</CompilerVersion>
        <Compiler>VisualStudio2019</Compiler>
    </WindowsPlatform>
    <VCProjectFileGenerator>
        <Version>VisualStudio2019</Version>
    </VCProjectFileGenerator>
</Configuration>

I have, multiple tines It just closes itself out after awhile since it already downloaded. It also setup the prerequisites.

You may have VS2019 installed but the compiler version may be messing with it. this build.xml that you seem to be using the one that i posted as a solution to my problem. the compiler version will need to changed probably.

i dont exactly remember how i found my compiler version.

the second thing is, you should update your engine. maybe it cant run with your newer compiler version.

Thanks for the response. I had issues with the compiler before so I ended up setting it directly. I can confirm that the contents of BuildConfiguration.xml is literally the same. But I went ahead and copied a similar one from a solution I found online. Literally changed nothing as the version was already the same though.

Other things I tried was uninstalled an re-installing the latest Windows development kit. I can confirm that this hasn’t worked either. However I did find a solution and I will make an answer with it. Actually found it seconds ago. To comment on the Engine version though. Updating Engine Versions isn’t a wise idea for C++ projects. Sure it’s something that I can definitely do but as I’m doing more and more C++ code nowadays to save me the headache and usually as my project gets closer to completion we do an Engine Version Freeze. In this case, I was having issues when updating to 4.24 but 4.23 didn’t add any features I desired so I opted to stay with 4.22 which successfully compiles.

I was able to solve this issue, by checking my Microsoft Visual Studio / 2019 / Community / VC / Tools / MSVC directory for the list of compilers I have installed. They are as follows.

14.22.27905 Which I can use on 4.22 without any issues.
14.24.28314 Which happened so solve this issue letting me generate the project files.

The issue here is the error told me that it requires 14.22.27905 to compile, but it really needed 14.24.28314 I think if this is an issue someone else is having that it definitely needs to be addressed.

Just update your BuildConfiguration.xml and change 14.22.27905 to 14.24.28314

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <CompilerVersion>14.24.28314</CompilerVersion>
        <Compiler>VisualStudio2019</Compiler>
    </WindowsPlatform>
    <VCProjectFileGenerator>
        <Version>VisualStudio2019</Version>
    </VCProjectFileGenerator>
</Configuration>