adamrehn/conan-ue4cli

generate command fails with UE 4.21.1

pdusen opened this issue · 2 comments

Following the instructions in the README and running this command:

ue4 conan generate

Results in the following error:

BuildException: One or more of the modules specified using the '-module' argument could not be found.

The full command log follows:

Removing the "ue4" Conan profile if it already exists...
Removing any previous versions of profile base packages...
Creating "ue4" Conan profile using autodetected settings...
Installing profile base packages...
Retrieving thirdparty library list from UBT...
Traceback (most recent call last):
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\pduse\AppData\Local\Programs\Python\Python35\Scripts\ue4.exe\__main__.py", line 9, in <module>
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\cli.py", line 216, in main
    SUPPORTED_COMMANDS[command]['action'](manager, args)
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\conan_ue4cli\main.py", line 34, in main
    SUBCOMMANDS[subcommand]['function'](manager, args[1:])
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\conan_ue4cli\generate.py", line 181, in generate
    libs = [lib for lib in manager.listThirdPartyLibs() if lib != 'libc++']
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\UnrealManagerBase.py", line 171, in listThirdPartyLibs
    return interrogator.list(self.getPlatformIdentifier(), configuration, self._getLibraryOverrides())
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\UE4BuildInterrogator.py", line 19, in list
    modules = self._getThirdPartyLibs(platformIdentifier, configuration)
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\UE4BuildInterrogator.py", line 147, in _getThirdPartyLibs
    self.runUBTFunc('UE4Editor', platformIdentifier, configuration, ['-gather', '-jsonexport=' + jsonFile, '-SkipBuild'])
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\UnrealManagerBase.py", line 605, in <lambda>
    ubtLambda = lambda target, platform, config, args: self._runUnrealBuildTool(target, platform, config, args, True)
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\UnrealManagerBase.py", line 597, in _runUnrealBuildTool
    return Utility.capture(arguments, cwd=self.getEngineRoot(), raiseOnError=True)
  File "c:\users\pduse\appdata\local\programs\python\python35\lib\site-packages\ue4cli\Utility.py", line 101, in capture
    '\nstderr: "' + stderr + '"'
Exception: child process ['C:\\Program Files\\Epic Games\\UE_4.21\\Engine\\Build\\BatchFiles\\Build.bat', 'UE4Editor', 'Win64', 'Development', '-gather', '-jsonexport=C:\\Users\\pduse\\AppData\\Local\\Temp\\tmpayqmru0r\\ubt_output.json', '-SkipBuild'] failed with exit code 5
stdout: "Compiling game modules for hot reload
Performing full C++ include scan (no include cache file)
Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
ERROR: One or more of the modules specified using the '-module' argument could not be found.
       (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
"
stderr: ""

For reference, here are the contents of Log.txt referred to in the command output:

UnrealBuildTool.GuardedMain: Command line: ..\..\Engine\Binaries\DotNET\UnrealBuildTool.exe  UE4Editor Win64 Development -gather -jsonexport=C:\Users\pduse\AppData\Local\Temp\tmpayqmru0r\ubt_output.json -SkipBuild -DEPLOY
WindowsPlatform.EnumerateSdkRootDirs: Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (1)
WindowsPlatform.EnumerateSdkRootDirs: Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (2)
WindowsPlatform.UpdateCachedWindowsSdks: Found Windows 10 SDK version 10.0.16299.0 at C:\Program Files (x86)\Windows Kits\10
WindowsPlatform.UpdateCachedWindowsSdks: Found Universal CRT version 10.0.16299.0 at C:\Program Files (x86)\Windows Kits\10
UnrealBuildTool.RunUBT: Compiling game modules for hot reload
UnrealBuildTool.RunUBT: Performing full C++ include scan (no include cache file)
VCToolChain.PrintVersionInfo: Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
VCToolChain.PrintVersionInfo: Compiler: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe
VCToolChain.PrintVersionInfo: Linker: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\link.exe
VCToolChain.PrintVersionInfo: Library Manager: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\lib.exe
UEBuildTarget.Build: Resource Compiler: C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\rc.exe
UEBuildTarget.AddPlugin: Enabling plugin 'Paper2D' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AISupport' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LightPropagationVolume' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ActorLayerUtilities' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CLionSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CodeLiteSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GitSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'KDevelopSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NullSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PerforceSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SubversionSourceControl' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'UObjectPlugin' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VisualStudioCodeSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VisualStudioSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'XCodeSourceCodeAccess' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AssetManagerEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CryptoKeys' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'DataValidation' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'FacialAnimation' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GameplayTagsEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MacGraphicsSwitching' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MeshEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'EditableMesh' (referenced via default plugins -> MeshEditor.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'MobileLauncherProfileWizard' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PluginBrowser' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SpeedTreeImporter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'DatasmithContent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'VariantManagerContent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AlembicImporter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GeometryCache' (referenced via default plugins -> AlembicImporter.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'AppleImageUtils' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AppleVision' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'BackChannel' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CharacterAI' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'HTML5Networking' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ProxyLODPlugin' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MagicLeap' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ProceduralMeshComponent' (referenced via default plugins -> MagicLeap.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'MagicLeapMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AvfMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ImgMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LinearTimecode' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MediaCompositing' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MediaPlayerEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WmfMedia' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'TcpMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'UdpMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ActorSequence' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LevelSequenceEditor' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MatineeToLevelSequence' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NetcodeUnitTest' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'NUTUnrealEngine4' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemGooglePlay' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystem' (referenced via default plugins -> OnlineSubsystemGooglePlay.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidPermission' (referenced via default plugins -> OnlineSubsystemGooglePlay.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemIOS' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemNull' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OnlineSubsystemUtils' (referenced via default plugins -> OnlineSubsystemNull.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'LauncherChunkInstaller' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AndroidMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AppleMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ArchVisCharacter' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'AudioCapture' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CableComponent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'CustomMeshComponent' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'ExampleDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'Firebase' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'GoogleCloudMessaging' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'IOSDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LinuxDeviceProfileSelector' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'LocationServicesBPLibrary' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'MobilePatchingUtils' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'OculusVR' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'PhysXVehicles' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'RuntimePhysXCooking' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'SteamVR' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WebMMoviePlayer' (referenced via default plugins)
UEBuildTarget.AddPlugin: Enabling plugin 'WebMMedia' (referenced via default plugins -> WebMMoviePlayer.uplugin)
UEBuildTarget.AddPlugin: Enabling plugin 'WindowsMoviePlayer' (referenced via default plugins)
Log.WriteException: ==============================================================================
Log.WriteException: ERROR: One or more of the modules specified using the '-module' argument could not be found.
Log.WriteException:        (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
Log.WriteException: 
Log.WriteException: BuildException: One or more of the modules specified using the '-module' argument could not be found.
Log.WriteException:    at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, CPPHeaders Headers, List`1 OutputItems, List`1 UObjectModules, ISourceFileWorkingSet WorkingSet, ActionGraph ActionGraph, EHotReload HotReload, Boolean bIsAssemblingBuild) in c:\Program Files\Epic Games\UE_4.21\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1895
Log.WriteException:    at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile, Boolean bCatchExceptions) in c:\Program Files\Epic Games\UE_4.21\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 1503
Log.WriteException: ==============================================================================

Sorry about that, this is my bad for not having properly documented conan-ue4cli yet. The issue is that you're attempting to generate wrappers using an Installed Build of the Unreal Engine obtained via the Epic Games Launcher, but wrapper packages can only be generated from the UE4 source tree, since Installed Builds don't include all of the necessary files. You'll need to point ue4cli to the root of the UE4 source tree and then run the generate command again.

I've now updated conan-ue4cli to terminate with a descriptive error message when this happens, and also updated the project README to include the relevant information. I'm planning on adding proper documentation for conan-ue4cli (akin to the ue4cli documentation) in the near future, once I've smoothed out the final quality-of-life kinks in the workflow for writing and consuming UE4-compatible Conan packages.