[4.7 Preview 5] C++ Code Hot Reload not working

I don’t seem able to get hot reload to work with a project I am working on under OSX. Hot reload has been working in previous versions of 4.7, but not in Preview 5:

Launching UnrealBuildTool... [/Users/Shared/UnrealEngine/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe GameName -ModuleWithSuffix GameName 7307 Mac Development -editorrecompile -canskiplink "/Volumes/Data/Source/GameName/GameName.uproject" -rocket  -rocket]
Warning: Starting HotReload took  0.0s.
CompilerResultsLog: New page: Compilation - 4 Feb 2015 21:22:44
CompilerResultsLog: Info 
CompilerResultsLog: Info Running Mono...
CompilerResultsLog: Info 
CompilerResultsLog: Info Setting up Mono
CompilerResultsLog: Info /Users/Shared/UnrealEngine/4.7/Engine /Users/Shared/UnrealEngine/4.7/Engine/Binaries/Mac
CompilerResultsLog: Info Compiling with Mac SDK 10.10
CompilerResultsLog: Info Target is up to date.
LogMainFrame: MainFrame: Module compiling took 2.027 seconds
LogModuleManager:Warning: ModuleManager: Unable to load module 'GameName' because the file '/Volumes/Data/Source/GameName/Binaries/Mac/UE4Editor-GameName-7307.dylib' was not found.
Warning: HotReload failed, reload failed /Script/GameName

Looking at the .../Binaries/Mac directory, it contains:

typhon:~ andy$ cd /Volumes/Data/Source/GameName/Binaries/Mac
typhon:Mac andy$ ls -l
total 1824
drwxr-xr-x  3 andy  staff     102  4 Feb 20:38 GameName-Mac-DebugGame.app
drwxr-xr-x  3 andy  staff     102  3 Feb 18:13 GameName.app
-rwxr-xr-x  1 andy  staff  653836  4 Feb 21:11 UE4Editor-GameName-Mac-DebugGame.dylib
-rwxr-xr-x  1 andy  staff  276816  4 Feb 21:11 UE4Editor-GameName.dylib

Hi trojanfoe,

I tried reproducing the issue you described both in Windows and OSX, but only had partial success. Everything seemed to work fine in Windows. In OSX, I created a new Blueprint project and added a new code class to the project. With the Editor still open, I built the project in XCode and saw a popup message stating that a dylib file could not be found. It gave me an option to rebuild that file, which I selected. That rebuilt the missing file and the build completed successfully.

Would you be able to provide some additional information?

  • Is this only happening within your project, or does it happen in a new project as well?
  • Did you upgrade this project from a previous preview of version 4.7?
  • Are there any specific changes you are making before performing the hot reload, or does this happen regardless of what changes you make to the code?
  • No, it’s not happening in a new project.
  • Yes - it was upgraded from 4.7 preview 4.
  • No, it doesn’t seem to matter what I do. I’ve tried various combinations of clean + build to no avail.

It would appear, however, that UBT is simply not complying with the instructions from the Editor; for example it’s not generating .dylib files with numbers which is the mechanism the hot reload system appears to use to move onto a new build of the code. Despite UBT apparently succeeding, it is not producing the file it was instructed to produce.

Hi trojanfoe,

I was unable to reproduce this issue because everyone here updated to Preview 5 shortly after it became available and I was not able to get a project created in Preview 4 and upgrade it to Preview 5. Using projects created in Preview 5, I was unable to see the results that you described. However, we are aware of a few issues in Preview 5 specifically related to upgrading projects from previous Preview versions. Preview 6, which is currently planned to be released later today, should have some improvements in this area. Please let us know if you see the same results in Preview 6. I am going to create a test project in Preview 5 and hold onto it until Preview 6 is released in case Preview 6 continues to show the same results for you.