I use a custom factory in my project to allow easy creation of custom assets in the editor. When I try to package my project, I get an error saying “Cannot open include file: ‘Factory.generated.h’: No such file or directory”.
I had a similar problem with a *.generated.h not being found/built. Ended up deleting the “./Intermediate/Build” folder of the project to fix it. The next build time was a bit of a bear, but it fixed the problem for me. Wasn’t related to a factory class though.
If that doesn’t work, I think I also greped for files under “./Intermediate” containing references to the offending header and deleted some those as well.
You cannot package a game shipping Editor modules. If you want to use factories, you must create a Module with IMPLEMENT_MODULE() macro and create your factories in there; making sure that module will NOT be loaded by GAME modules. This is why your packaging fails, because you implement references to classes that are Editor only.
To create an Editor Module for your game project, look at a guide here: