Can anybody tell whats the difference? I searched the whole VS Solution for ANY_PACKAGE and the only thing that comes up is: #define ANY_PACKAGE ((UPackage*)-1) in ObjectMacros.h
Changing the include should not make any difference, as that is the only definition there is.
My code (plugin code) compiles fine for development, but the error comes up when trying build the plugin for shipping in 4.20. Also strange: the problem seems to occour in 4.16 already but in 4.19 I had no issue with it.
@Rumbleball : The unity build feature of Unreal (which merges a lot of .cpp files into a single file during compilation for shorter compile time) can hide missing includes. Probably some other .cpp file got into the same unity compile chunk, which had the include that was actually missing in the first file the whole time.
The culprit seems to be specifically StructOnScope.h, which is indirectly included by EngineMinimal.h, but not CoreMinimal.h. That file does mention the UPackage class. I have not looked further though.