It would be helpful to others I think, and certainly my sanity, if the comment below also said “This assert can be triggered by attempting to open a 64-bit plugin in a 32-bit host or vice versa”.
IPluginFactory* JUCE_CALLTYPE getPluginFactory()
{
//...
jassert (factory != nullptr); // The plugin NEEDS to provide a factory to be able to be called a VST3!
}