Wednesday, October 10, 2018

Updating C++ Project to Unreal Engine 4.21p1

So, the Unreal Engine 4.21 Preview 1 came out earlier today, so of course I immediately installed it and updated all my projects to 4.21p1, and all the blueprint projects upgrades perfectly without a hitch except the flappy bird one.

However, the C++ projects are having some issues moving over to the new version. For whatever reason, I keep getting this error:
ERROR: Couldn't find target rules file for target 'UE4Editor' in rules assembly 'UEProject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Here's the full error  log:
 UnrealBuildTool.GuardedMain: Command line: "c:/Program Files/Epic Games/UE_4.21/Engine/Binaries/DotNET/UnrealBuildTool.exe" Development Win64 -Project="D:/UEProject 4.21 - 2/UEDevCourse.uproject" -TargetType=Editor -Progress -NoHotReloadFromIDE
 GitSourceFileWorkingSet..ctor: Using 'git status' to determine working set for adaptive non-unity build (D:\UEProject 4.21 - 2).
 UnrealBuildTool.RunUBT: Creating makefile for UEDevCourseEditor (no existing makefile)
 Log.WriteException: ==============================================================================
 Log.WriteException: ERROR: Couldn't find target rules file for target 'UE4Editor' in rules assembly 'UEDevCourseModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
 Log.WriteException:        Location: D:\UEProject 4.21 - 2\Intermediate\Build\BuildRules\UEDevCourseModuleRules.dll
 Log.WriteException:        Target rules found:
 Log.WriteException:            UEDevCourse - D:\UEProject 4.21 - 2\Source\UEDevCourse.Target.cs
 Log.WriteException:            UEDevCourseEditor - D:\UEProject 4.21 - 2\Source\UEDevCourseEditor.Target.cs
 Log.WriteException:       
 Log.WriteException:        (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
 Log.WriteException:
 Log.WriteException: BuildException: Couldn't find target rules file for target 'UE4Editor' in rules assembly 'UEDevCourseModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
 Log.WriteException: Location: D:\UEProject 4.21 - 2\Intermediate\Build\BuildRules\UEDevCourseModuleRules.dll
 Log.WriteException: Target rules found:
 Log.WriteException:     UEDevCourse - D:\UEProject 4.21 - 2\Source\UEDevCourse.Target.cs
 Log.WriteException:     UEDevCourseEditor - D:\UEProject 4.21 - 2\Source\UEDevCourseEditor.Target.cs
 Log.WriteException:
 Log.WriteException:    at UnrealBuildTool.RulesAssembly.CreateTargetRules(String TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, String Architecture, FileReference ProjectFile, ReadOnlyBuildVersion Version, String[] Arguments, FileReference& TargetFileName) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 583
 Log.WriteException:    at UnrealBuildTool.RulesAssembly.CreateTargetRules(String TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, String Architecture, FileReference ProjectFile, ReadOnlyBuildVersion Version, String[] Arguments) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 543
 Log.WriteException:    at UnrealBuildTool.UEBuildTarget.ValidateSharedEnvironment(RulesAssembly RulesAssembly, String ThisTargetName, TargetRules ThisRules) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 547
 Log.WriteException:    at UnrealBuildTool.UEBuildTarget.CreateTarget(TargetDescriptor Desc, String[] Arguments, Boolean bSkipRulesCompile, Boolean bCompilingSingleFile, Boolean bUsePrecompiled, ReadOnlyBuildVersion Version) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 406
 Log.WriteException:    at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile, Boolean bCatchExceptions) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 1415
 Log.WriteException: ==============================================================================
 After hours of trying to figure out how to fix this damn thing, I ended up creating a new project and re-importing the whole thing. Steps:


  1. Create a new project with same name. This is key. The project must have the same name.
  2. Copy everything that is not C++ into the new project. 
  3. Open the project, close it. I needed to do this step because UE4 needed recompile 4000 shaders for some reason.
  4. Create new C++ classes with the same name corresponding to all the C++ classes from the previous project.
  5. Copy everything that is C++ into the new project.
  6. Open the project, compile.


Everything works perfectly as before.

No comments:

Post a Comment

The True Frontier - Cordwainer Smith

The following is a transcription of Extra Sci-fi’s episode “The True Frontier - Cordwainer Smith” What if I told you that one of the great...