Cannot create c++ project "Hexadecimal value 0x00 is an invalid character"

An error occurred while trying to generate project files.

Running C:/Program Files/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Users/DarkK/Documents/Unreal Projects/PaperZD/PaperZD.uproject” -game -rocket -progress
‘.’, hexadecimal value 0x00, is an invalid character. Line 1, position 1.

Happens with 4.16 and 4.17

Guys, I opened the source code project for UnrealBuildTool and debugged that line of code

for some reason:

…AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml

Had only NULL characters written (as illustrated by notepad++), removing this file fixed the issue

Hi, I’m having the same issue. I have tried everything and even reinstalled windows with no fix.
Would you be able to explain how you fixed it? What exact file did you open and what did you modify?

It was the BuildConfiguration.xml file from unreal engine AppData… had null characters for some reason (they are visible in editors like Notepad++)… removing that file fixed the issue

Crazy week, sorry for not answering

I might add, that the solution could be the same but also in the My Documents/Unreal Engine folder.
BuildConfiguration.xml is sometimes in there as well, and if it has nothing inside the file then UE4 will give you the same error. It seems that if the file exists in My Documents, UE4 references it instead of the usual one.