[4.9.0] [Plugins] Can't delete Intermediate folder of plugin

Dear Epic,

I have discovered an issue that was not present in 4.8.3 which makes distribution of plugins to other people very difficult.

The issue is that if the Intermediate folder of a plugin is deleted, than the plugin cannot be recompiled from that point onward using the project-level sln.

The error I get is this

PCH.HappyPluginPrivatePCH.h.cpp
2>c1xx : fatal error C1083: Cannot open source file: 'C:\Users\\Documents\Unreal Projects\Basic\Plugins\HappyPlugin\Intermediate\Build\Win64\UE4Editor\Development\HappyPlugin\PCH.HappyPluginPrivatePCH.h.cpp': No such file or directory

#Repro Steps

  1. Make a new project, blank C++
  2. Make a new plugin using the in-editor New Plugin tool new in 4.9.0
  3. Make the middle option, which is a new button added to level viewport
  4. Close editor and reopen it / restart using the plugin option
  5. After the plugin code is compiled and working in Editor (you’ll see new button on toolbar,
  6. Close Editor
  7. Open sln for project in VS
  8. Delete the plugin Intermediate folder as if preparing the plugin content for distribution
  9. Try to recompile the project that contains the newly created plugin (for Development Editor Win64)

Whatever you named the plugin you’ll get a compile error similar to this:

PCH.HappyPluginPrivatePCH.h.cpp
2>c1xx : fatal error C1083: Cannot open source file: 'C:\Users\\Documents\Unreal Projects\Basic\Plugins\HappyPlugin\Intermediate\Build\Win64\UE4Editor\Development\HappyPlugin\PCH.HappyPluginPrivatePCH.h.cpp': No such file or directory

This did not happen in 4.8.3

#Why this is a Big Deal

The Intermediate folders for plugins can often be around 1 GB in size, and should not be needed by many people, especially BP only projects.

It makes it very hard to store the plugin for distribution!

Plugin size without Intermediate = 72 MB

Plugin size with Intermediate = 924 MB

#Solution?

What is the solution for how we can distribute plugins without the Intermediate folder and still allow C++ users to recompile the plugin for their possibly custom engine version?

It happens also to plugins in game projects directories?

Hey -

I was not successful in trying to reproduce this on my machine. After step 6 I deleted the Intermediate folder for my plugin in the Window’s path. Building the project solution in DevelopmentEditor Win64 completed and recreated the Intermediate folder inside my plugin. Please let me know if there’s something I missed in my process.

Cheers

@anonymous_user_f5a50610

Hiiii!

I am only referring to plugins created at the game project level :slight_smile:

@

I am currently unable to reproduce this issue for additional new projects. I will leave this thread here in case the issue resurfaces, if you’d like to mark this as answered please convert your comment to an answer and I can mark it answered until I repro the issue.

Thanks for taking the time to look into this!

I am really not sure why everything is working great now but I’ll take it :slight_smile:

#Thank you for UE4!

#:heart:

#The Solution

I have continued to get this error occasionally, I found the solution though!

If you do a Rebuild of the VS solution for your project the error goes away for all affected plugins.

Build->Rebuild Solution

Just make sure to not do this with a Github Engine build :slight_smile:

#:heart: