How to force to rebuild precompiled header for Android

I have modified the AndroidFile.h and then when I build the game for Android, I get this error

Packaging (Android (ETC2)): UnrealBuildTool: fatal error: file 'E:\UnrealEngine-4.10\Engine\Source\Runtime/Core/Public\Android/AndroidFile.h' has been modified since the precompiled header 'E:/Project/MyGame/Intermediate/Build/Android/MyGame/Development/MyGame/MyGame-armv7-es2.h.gch' was built
UnrealBuildTool: note: please rebuild precompiled header 'E:/Project/MyGame/Intermediate/Build/Android/MyGame/Development/MyGame/MyGame-armv7-es2.h.gch'
UnrealBuildTool: 1 error generated.
UnrealBuildTool: fatal error: file 'E:\UnrealEngine-4.10\Engine\Source\Runtime/Core/Public\Android/AndroidFile.h' has been modified since the precompiled header 'E:/Project/MyGame/Intermediate/Build/Android/MyGame/Development/MyGame/MyGame-armv7-es2.h.gch' was built
UnrealBuildTool: note: please rebuild precompiled header 'E:/Project/MyGame/Intermediate/Build/Android/MyGame/Development/MyGame/MyGame-armv7-es2.h.gch'
UnrealBuildTool: 1 error generated.

How should I manually rebuild the precompiled header?

Hello ,

I’ve never needed to rebuild this precompiled header in particular, but it should be rebuilt whenever you run the Generate Project Files option. You can do this by right-clicking your .uproject file and selecting the option from the bottom of the list.

Yes, that’s suck, I figure out that the only way to make it rebuild is to do a clean for the project

In my case I had it when I performed a “sdk_manager.bat --update” AFTER I built my project a first time.

To avoid that, just delete the “Intermediate” folder of your prokect and perform a packaging.

1 Like