landelare/ue5coro

UnrealBuildTool packing error - Could not find definition for module 'UE5Coro'

datoslabs opened this issue · 6 comments

Hi,

I really appreciate the work you have done here. I am fairly new to Unreal Engine and c++; UE5Coro has made it so much easier for me to implement async multi-threaded code with WinRT libraries -- THANK YOU!!

I wrote a C++ plugin (UE5.4.3) with UE5Coro as dependency. I followed the instructions to install UE5Coro into my project and was able to compile and run successfully. However, as I tried to package my plugin so it can be used in my main project, I encountered an error as follows:

CompilationResultException: Could not find definition for module 'UE5Coro', (referenced via Target -> [MyPlugin].Build.cs)
   at UnrealBuildTool.RulesAssembly.CreateModuleRules(String ModuleName, ReadOnlyTargetRules Target, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 441
   at UnrealBuildTool.RulesAssembly.CreateModuleRules(String ModuleName, ReadOnlyTargetRules Target, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 437
   at UnrealBuildTool.RulesAssembly.CreateModuleRules(String ModuleName, ReadOnlyTargetRules Target, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 437
   at UnrealBuildTool.RulesAssembly.CreateModuleRules(String ModuleName, ReadOnlyTargetRules Target, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 437
   at UnrealBuildTool.RulesAssembly.CreateModuleRules(String ModuleName, ReadOnlyTargetRules Target, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 437
   at UnrealBuildTool.UEBuildTarget.CreateModuleRulesAndSetDefaults(String ModuleName, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 5339
   at UnrealBuildTool.UEBuildTarget.FindOrCreateModuleByName(String ModuleName, String ReferenceChain, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 5463
   at UnrealBuildTool.UEBuildTarget.<>c__DisplayClass71_0.<PreBuildSetup>b__0(String Name, String RefChain) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 3384
   at UnrealBuildTool.UEBuildModule.RecursivelyCreateModulesByName(List`1 ModuleNames, List`1& Modules, Boolean& bDependsOnVerse, CreateModuleDelegate CreateModule, String ReferenceChain, List`1 ReferenceStack, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildModule.cs:line 1274
   at UnrealBuildTool.UEBuildModule.RecursivelyCreateModules(CreateModuleDelegate CreateModule, String ReferenceChain, List`1 ReferenceStack, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildModule.cs:line 1137
   at UnrealBuildTool.UEBuildBinary.CreateAllDependentModules(CreateModuleDelegate CreateModule, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildBinary.cs:line 162
   at UnrealBuildTool.UEBuildTarget.PreBuildSetup(ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 3382
   at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bForceRulesCompile, Boolean bUsePrecompiled, UnrealIntermediateEnvironment IntermediateEnvironment, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1392
   at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, BuildConfiguration BuildConfiguration, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1226
   at UnrealBuildTool.BuildMode.CreateMakefileAsync(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 1114
   at UnrealBuildTool.BuildMode.BuildAsync(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 396
   at UnrealBuildTool.BuildMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 252
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\Program Files\Epic Games\UE_5.4\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 660

I tried adding UE5Coro as a dependency in [MyPlugin].uplugin but it also failed with similar error. I also tried to package UE5Coro plugin but it generated several compilation errors and failed to build.

I am using UE5Coro V2.0RC and MSVC 14.41.34120. Please advice. Thank you again for all the great work!

Do you think there's a bug somewhere, i.e., if you depend on another non-engine plugin module in the same way, does that work?

You are right! I added 2 dummy plugins A & B to a UE5.4.3 project and ran several tests where B depends on A. Even when B does not physically depend on A, unrealbuildtool throws the same error as soon as A is added to B.build.cs file as a dependency. I will ask the same question in UE forum...

I encountered many compilation errors trying to package UE5Coro v2.0rc, do I need additional setup steps to successfully package this plugin? I am thinking if I can package UE5Coro, I can move it to engine marketplace plugin and maybe this way I can package my plugin.

I and most Unreal users I talked to don't bother packaging plugins separately, but let the regular game builds handle them. I would not be surprised if your problem was exclusive to the plugin packaging process. It's not something that I test or support.

The only reason I tried to package my plugin is so I can use it in my main game project; I created a separate project for plugin development so that it's easier to unit test and faster to build. I am fairly new to Unreal Engine so I am still learning and figuring out best/optimal workflow. Is there a way to share plugins among multiple projects (or in my case use my c++ plugin in blueprint only project) without packaging?

BTW, I ran a quick test and it appears that after plugin A is packaged and copied into [UE install dir]\Engine\Plugins\Marketplace; plugin B, with dependency on A, can be packaged without previously encountered error. It appears that the UnrealBuildTool will only search for dependent modules within the [UE install dir]\Engine\Plugins\ and [UE install dir]\Engine\Plugins\Marketplace directories whereas the VS2022 Build Solution will search for the project's own Plugins directory for dependent modules in addition to engine's plugin directories.

Closing this, since it's not a bug.