Necroing this post because I encountered this issue today and figured out why it occured in my case.
The issue in my case was that I had a struct with a UCLASS macro above it, which obviously should not be the case (and instead should be a USTRUCT macro).