Can't hot-reload inside UE4 after building from source

Hey guys,

When I try to hot-reload my FlightPrototype project, ever since I built from source, I get the following error message in the log:

Info ERROR: Couldn't find target rules file for target 'FlightPrototype' in rules assembly 'FlightPrototype_EditorRecompileModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Info Location: C:\P4_BH_MM\UnrealEngine\Engine\Intermediate\Build\BuildRules\FlightPrototype_EditorRecompileModuleRules.dll
Info Target rules found:
Info     UE4Client - C:\P4_BH_MM\UnrealEngine\Engine\Source\UE4Client.Target.cs
Info     UE4Editor - C:\P4_BH_MM\UnrealEngine\Engine\Source\UE4Editor.Target.cs
Info     UE4Game - C:\P4_BH_MM\UnrealEngine\Engine\Source\UE4Game.Target.cs
Info     UE4Server - C:\P4_BH_MM\UnrealEngine\Engine\Source\UE4Server.Target.cs
Info     BlankProgram - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\BlankProgram\BlankProgram.Target.cs
Info     CrashReportClient - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\CrashReporter\CrashReportClient\CrashReportClient.Target.cs
Info     MinidumpDiagnostics - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\CrashReporter\MinidumpDiagnostics\MinidumpDiagnostics.Target.cs
Info     UnrealLaunchDaemon - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\IOS\UnrealLaunchDaemon\UnrealLaunchDaemon.Target.cs
Info     UE4EditorServices - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\Mac\UE4EditorServices\UE4EditorServices.Target.cs
Info     ShaderCompileWorker - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\ShaderCompileWorker\ShaderCompileWorker.Target.cs
Info     SlateViewer - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\SlateViewer\SlateViewer.Target.cs
Info     SymbolDebugger - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\SymbolDebugger\SymbolDebugger.Target.cs
Info     UnrealFileServer - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealFileServer\UnrealFileServer.Target.cs
Info     UnrealFrontend - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealFrontend\UnrealFrontend.Target.cs
Info     UnrealHeaderTool - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealHeaderTool\UnrealHeaderTool.Target.cs
Info     UnrealLightmass - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealLightmass\UnrealLightmass.Target.cs
Info     UnrealPak - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealPak\UnrealPak.Target.cs
Info     UnrealSync - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealSync\UnrealSync.Target.cs
Info     UnrealVersionSelector - C:\P4_BH_MM\UnrealEngine\Engine\Source\Programs\UnrealVersionSelector\UnrealVersionSelector.Target.cs
Info 

Any ideas?

EDIT: Pasting log output as ‘code’ so no characters are omitted.

Any insights? This log output isn’t something I can use to fix the issue.

This is still an issue, and quite a workflow hindrance.

Hi ,

Is this occurring with version 4.3.1 built from source code? Do you see the same results with 4.4.0? Are you seeing an actual crash occur, or does the hot reload fail with the resulting log that you provided?

Just so I understand where you started with your project, this project was originally created using the binary version of the Engine from the Launcher, then changed to use the Engine that you had built from source code?

Hi ,

Yeah this is 4.3 built from source (I do not think from 4.3.1 - how can I easily tell? It was a little while ago). Haven’t tried 4.4.0 yet - waiting on 4.4.1 most likely. There is no crash, just that output in the editor’s log.

That is correct - it was originally created on 4.2 binaries, was moved to 4.3.0, and now to source. Maybe this has resulted in the lack of ‘target rules’?

To check the current version of the Editor you are using, you can go to Help -> About Unreal Editor... and the version number will be displayed on the right side of the window that opens.

I tried creating a new project using the binary version of 4.2, then upgraded that project to the binary 4.3, then to 4.3 built from source and did not have any problems when using hot reload. Do you get the same message if you create a new project using the Engine that you built from source?

The source version I’m using is definitely 4.3.0.

I tried making a project from the 4.3 source and hot reload works fine. Is there a file I can provide to you, or an option to reset some configuration settings?

I think I might know what is happening. Just one more question to make sure I am on the right track. Did you copy your FlightPrototype project folder into the Engine folder when you built your Engine from source code?

I copied it in thusly;

UnrealEngine/FlightPrototype
UnrealEngine/Engine

Hi ,

If you have copied your project folder into your UE4 folder, you will need to create a .uprojectdirs file inside your UE4 folder. Create a new text file inside your UE4 folder named UE4.uprojectdirs. Edit the file to include the following lines:

.
Projects

13435-ue4folder.png

The Projects line is only necessary if you want to create a Projects subfolder to contain your projects, as I show in the picture above. If you placed your project folder directly into your UE4 folder (instead of a Projects folder, you have your FlightPrototype folder), you only need the line with the .. I ran a test on a project I created inside the Engine folder (using 4.4) and got the same error you described when I tried to do a hot reload. Adding the .uprojectdirs file to the Engine folder solved the problem for me. It should work the same with 4.3.

Also, if you run the GenerateProjectFiles.bat file in your UE4 folder after creating the .uprojectdirs file, you will be able to see your game project inside the UE4 source code solution (ie. if you open UE4.sln).

Ahh , you’ve done it again! Thought I’d test it out for a bit, but it’s been all fine and dandy since you suggested it. I wonder though - is it standard to have a ‘Projects’ folder, and what is it that the .uprojectdirs file does?

Unreal Engine 4 has two options for working with game projects: 1) Create and store game projects in a separate location from where the Engine is located on the hard drive, or 2) create and store game projects in the same location where the Engine is located.

The first option is the default assumption the Engine makes. Unless the user specifies a different location, the Engine will create new projects inside an Unreal Projects folder located inside the user’s Documents folder. Users are able to specify alternate locations for where newly created projects will be stored, but as long as the location specified is not in the Engine’s root folder, this functionality will be the same. Projects created in this fashion are not directly linked to the Engine, and can be more easily moved around to different locations or different computers.

The second option integrates a game project with the Engine, and requires the use of the .uprojectdirs file. If you either create a new project within the root folder of the Engine or move a project into the Engine’s root folder, you will achieve this result. This option is best suited to sharing a project through a version control system if you also want the Engine included in the version control so that everyone is working on the same project and Engine version. One catch with this option, however, is that if you create a brand new project within the Engine’s root folder, you will only be able to access the project’s source code through the Engine’s solution file (UE4.sln). The project will not get its own solution file.

While not strictly necessary, it is generally a good idea to have a Projects folder somewhere on your hard drive where you will store your game projects. As I mentioned before, the Engine defaults to using an Unreal Projects folder in your user Documents, but you do not have to use that if you don’t want to.

The .uprojectdirs file lets the Engine know what folders within its root folder may contain .uproject files. The . character I mentioned in my answer tells the Engine to go down one level in each folder in the root Engine folder looking for a .uproject file. If it finds one, it integrates that game project into the Engine solution. If you include a Projects folder in the Engine root folder, and add the line Projects to the .uprojectdirs file, the Engine will also look one level down in any folders contained in the Projects folder.