If anyone is still struggling… In your header files, you should have the following includes:
#include "CoreMinimal.h" // Must be first
(...) // Other #includes
#include "xxxxx.generated.h" // Must be last (xxxxx is the name of the header file itself)
In “other includes”, you should include the headers that define your base class and any other class that you use as member variables.
In your cpp files:
#include "xxxxx.h" // Must be first (xxxxx is the name of the header file for this cpp file)
(...) // Other #includes
In “other includes”, you should include the headers that define any other class that you use in the code, and that have not already been included in your header (it’s ok to have the same include in both files).
After rearranging the #includes, try doing a full rebuild (ctrl+alt+F7) instead of a simple build (F7).