Runtime error with plugins built via command line.

For a while now I’ve been building all my plugins using the UBT command line, and including only the binaries, content, and build.cs files within the Plugins subfolder of the projects I use the plugins in. The reason is that if I copy all the source into every project where I need the plugin, I have to deal with source control (if the plugin is still in development) as well as bloated intermediate folders from rebuilding the plugin in the context of every project.

Am I correct in assuming that UE4 plugins should not need to be built separately for each project they are to be used with? I have had no issues at all using this approach until recently when I tried to run a packaged game incorporating a plugin, and hit an error on startup (see comment here).

The commands I use to build the plugin are:

UnrealBuildTool.exe UE4Editor Win64 Development -plugin "path-to-standalone-plugin/PluginName.uplugin" -nobuilduht
UnrealBuildTool.exe UE4Game Win64 Development -plugin "path-to-standalone-plugin/PluginName.uplugin" -nobuilduht

I then copy across the resulting binaries into the Binaries folder of the plugin within my project folder. All works as expected within the Editor, and packaging reports no errors, but packaged builds fail at startup.

Is there anything wrong with this approach? Are binary-only plugins not supported?
Since having this issue I’ve noticed that the dll/lib files generated differ in size depending on which method is used to build the plugin.

I can provide a repro project and plugin by PM on request.

Hello,

Ensure that the Full Rebuild option is turned off under Edit->Project Settings->Packaging

You can also do your shipping build in Visual Studio before packaging just to ensure that there aren’t any additional errors.

It may be that the plugin requires there to be at least one source file in the plugin, even if the source file does not have any function. So this may be something that you need to add as a test to see if you are still getting the errors using that method.

Let me know if that helps.

Hello,

This should work, although it is not the expected workflow so we do not test it or have documentation on this method. It sounds like you may not be copying the correct files. If you could provide the project to me through PM, I can take a closer look: https://forums.unrealengine.com/member.php?160394-Sean-Flint

Have a great day

Hi Sean, sorry for the delay.

I just now attempted to reproduce this with 4.12 before sending you the project, and did so. However, running the two build commands given in the original post resulted in the engine binaries UE4Editor,exe and UE4Game.exe being deleted from the (launcher version) engine installation directory as part of the process of building the plugin!

This doesn’t make a whole lot of sense to me, but anyway it would appear that running UnrealBuildTool.exe with the -plugin option is perhaps no longer supported.

Anyway, I’ll send you a PM with a link to the project if you want to investigate.