Packaging Android (ETC1) HAL PlatformCrt.h fatal error: 'new' file not found

On packaging a blank c++ project with no starter content for Android using Downloaded Engine and Visual Studio 2017 community edition from, i get an error.

UATHelper: Packaging (Android (ETC1)):   Compiling Native code with NDK API 'android-19'
UATHelper: Packaging (Android (ETC1)):   Building 6 actions with 4 processes...
UATHelper: Packaging (Android (ETC1)):     [1/6] SharedPCH.Engine.h [armv7-es2]
UATHelper: Packaging (Android (ETC1)):     In file included from C:/Users/user/Documents/Unreal Projects/MPuzzle/Intermediate/Build/Android/MPuzzle/Development/Engine/SharedPCH.Engine.h:110:
UATHelper: Packaging (Android (ETC1)):     In file included from C:\Program Files\Epic Games\UE_4.20\Engine\Source\Runtime\Engine\Public\EngineSharedPCH.h:8:
UATHelper: Packaging (Android (ETC1)):     In file included from C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\Misc/Exec.h:6:
UATHelper: Packaging (Android (ETC1)):     In file included from C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\Misc/AssertionMacros.h:6:
UATHelper: Packaging (Android (ETC1)):     In file included from C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\HAL/PlatformMisc.h:5:
UATHelper: Packaging (Android (ETC1)):     In file included from C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\GenericPlatform/GenericPlatformMisc.h:7:
UATHelper: Packaging (Android (ETC1)):     C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\HAL/PlatformCrt.h(5,10):  fatal error: 'new' file not found
UATHelper: Packaging (Android (ETC1)):     #include <new>
UATHelper: Packaging (Android (ETC1)):              ^~~~~
UATHelper: Packaging (Android (ETC1)):     1 error generated.
PackagingResults: Error: 'new' file not found
UATHelper: Packaging (Android (ETC1)):   ERROR: UBT ERROR: Failed to produce item: C:\Users\user\Documents\Unreal Projects\MPuzzle\Binaries\Android\MPuzzle-armv7-es2.so
UATHelper: Packaging (Android (ETC1)):          (see C:\Users\user\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.20\UBT-MPuzzle-Android-Development_2.txt for full exception trace)
PackagingResults: Error: UBT ERROR: Failed to produce item: C:\Users\user\Documents\Unreal Projects\MPuzzle\Binaries\Android\MPuzzle-armv7-es2.so
UATHelper: Packaging (Android (ETC1)):   Total build time: 25.79 seconds (Parallel executor: 0.00 seconds)
UATHelper: Packaging (Android (ETC1)): Took 26.7847449s to run UnrealBuildTool.exe, ExitCode=5
UATHelper: Packaging (Android (ETC1)): ERROR: UnrealBuildTool failed. See log for more details. (C:\Users\user\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.20\UBT-MPuzzle-Android-Development_2.txt)
UATHelper: Packaging (Android (ETC1)):        (see C:\Users\user\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.20\Log.txt for full exception trace)
PackagingResults: Error: UnrealBuildTool failed. See log for more details. (C:\Users\user\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.20\UBT-MPuzzle-Android-Development_2.txt)
UATHelper: Packaging (Android (ETC1)): AutomationTool exiting with ExitCode=5 (5)
UATHelper: Packaging (Android (ETC1)): BUILD FAILED
PackagingResults: Error: Unknown Error

This ‘new’ file

UATHelper: Packaging (Android (ETC1)):     C:/Program Files/Epic Games/UE_4.20/Engine/Source/Runtime/Core/Public\HAL/PlatformCrt.h(5,10):  fatal error: 'new' file not found
UATHelper: Packaging (Android (ETC1)):     #include <new>
UATHelper: Packaging (Android (ETC1)):              ^~~~~
UATHelper: Packaging (Android (ETC1)):     1 error generated.

is in the MSVC include folder?

You need an older version of NDK. Download one from NDK Archives and set it in the project settings.

The problem is that the UE build system hardcodes the paths to GCC version of libstdc++, but the latest NDK only ships the LLVM libstdc++.

This was the solution for me. I was using CodeWorks for Android and installed the latest version R8, which updated the NDK to 18 and then I got the error. I manually downgraded the NDK to 17c and this fixed the issue.

Worked for me too. Thanks for the solution!