Description

If disable PCH in Target.cs, an error will occur when building for Android. The log is as follows.

LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(40,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(40,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(40,59): error: use of undeclared identifier 'SP_VULKAN_PCES3_1'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(41,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(41,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(41,61): error: use of undeclared identifier 'SP_VULKAN_PCES3_1'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_PCES3_1;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(42,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM4] = SP_VULKAN_SM4;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(42,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM4] = SP_VULKAN_SM4;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(42,59): error: use of undeclared identifier 'SP_VULKAN_SM4'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM4] = SP_VULKAN_SM4;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(43,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM5] = SP_VULKAN_SM5;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(43,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM5] = SP_VULKAN_SM5;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/../VulkanGenericPlatform.h(43,59): error: use of undeclared identifier 'SP_VULKAN_SM5'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM5] = SP_VULKAN_SM5;
LogPlayLevel: ^
LogPlayLevel: In file included from D:/UnrealProject/TestAndroid/Intermediate/Build/Android/Test421_all/Development/VulkanRHI/Module.VulkanRHI.1_of_3.cpp:2:
LogPlayLevel: In file included from D:\Build\Release-4_21_0\Engine\Source\Runtime\VulkanRHI\Private\Android\VulkanAndroidPlatform.cpp:13:
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(60,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(60,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(60,59): error: use of undeclared identifier 'SP_VULKAN_ES3_1_ANDROID'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES2] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(61,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(61,34): error: use of undeclared identifier 'ERHIFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(61,61): error: use of undeclared identifier 'SP_VULKAN_ES3_1_ANDROID'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::ES3_1] = SP_VULKAN_ES3_1_ANDROID;
LogPlayLevel: ^
LogPlayLevel: Error: D:/Build/Release-4_21_0/Engine/Source/Runtime/VulkanRHI/Private/Android/VulkanAndroidPlatform.h(62,3): error: use of undeclared identifier 'GShaderPlatformForFeatureLevel'
LogPlayLevel: GShaderPlatformForFeatureLevel[ERHIFeatureLevel::SM4] = SP_NumPlatforms;
LogPlayLevel: ^
LogPlayLevel: Error: fatal error: too many errors emitted, stopping now [-ferror-limit=]
LogPlayLevel: 20 errors generated.
LogPlayLevel: Error executing C:\NVPACK\android-ndk-r14b\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe (tool returned code: 1)
LogPlayLevel: ---------------------- Done ----------------------
LogPlayLevel: Rebuild All: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped
LogPlayLevel: Took 2.2823151s to run xgConsole.exe, ExitCode=1
LogPlayLevel: Error: ERROR: Command failed (Result:1): C:\Program Files (x86)\Xoreax\IncrediBuild\xgConsole.exe "D:\Build\Release-4_21_0\Engine\Programs\AutomationTool\Saved\Logs\UAT_XGE.xml" /Rebuild /NoLogo /ShowAgent /ShowTime /no_watchdog_thread. See logfile for details: 'xgConsole-2018.12.06-11.51.59.txt'
LogPlayLevel: (see D:\Build\Release-4_21_0\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Build Task, Time: 9.250432
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

After adding #include "RHI.h" to VulkanGenericPlatform.h, this issue does not occur.

Steps to Reproduce
  1. Add following code to <ProjectName>.Target.cs 
    bUsePCHFiles = false;
  2. Launch on Android
  3. Error occurs

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-67241 in the post.

0
Login to Vote

Fixed
ComponentUE - Graphics Features
Affects Versions4.21
Target Fix4.22
Fix Commit4653118
Main Commit4854553
Release Commit4862694
CreatedDec 6, 2018
ResolvedDec 12, 2018
UpdatedSep 16, 2019
View Jira Issue