proletariatgames / unreal.hx

Unreal.hx: Haxe Integration for Unreal
MIT License
423 stars 43 forks source link

Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception #79

Closed matthewswallace closed 6 years ago

matthewswallace commented 6 years ago

I'm using UE 4.17.2. After adding the plugin to my project and compiling I get the following error in the UE4 console. I am trying this on MacOS so I'm guessing there is some config somewhere that I need to change so that this doesn't happen ?


CompilerResultsLog: BuildApi.Build.cs: Using Haxe
CompilerResultsLog: Calling Haxe
CompilerResultsLog: Calling the build tool with arguments --cwd "/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2/Plugins/UnrealHx/Haxe/BuildTool" compile-project.hxml -D "EngineDir=/Users/Shared/Epic Games/UE_4.17/Engine" -D "ProjectDir=/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2" -D "TargetName=MyProject2Editor" -D "TargetP
latform=Mac" -D "TargetConfiguration=Development" -D "TargetType=Editor" -D "ProjectFile=/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2/MyProject2.uproject" -D "PluginDir=/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2/Plugins/UnrealHx" -D UE_BUILD_CS
CompilerResultsLog: ERROR: Unable to instantiate instance of 'MyProject2' object type from compiled assembly 'MyProject2ModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.  Unreal Build Tool creates an instance of your module's 'Rules' object in order to find out about your module's requirements.  The CLR exception details may provide more i
nformation:  System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception: ApplicationName='haxe', CommandLine='--cwd "/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2/Plugins/UnrealHx/Haxe/BuildTool" compile-project.hxml -D "EngineDir=/Users/Shared/Epic Games/U
E_4.17/Engine" -D "ProjectDir=/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2" -D "TargetName=MyProject2Editor" -D "TargetPlatform=Mac" -D "TargetConfiguration=Development" -D "TargetType=Editor" -D "ProjectFile=/Users/mwallace/Dropbox/Development/Unreal Projects/MyProject2/MyProject2.uproject" -D "PluginDir=/Users/mwallace/Dropbox/Development
/Unreal Projects/MyProject2/Plugins/UnrealHx" -D UE_BUILD_CS', CurrentDirectory='', Native error= Cannot find the specified file
CompilerResultsLog:   at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0
CompilerResultsLog:   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
CompilerResultsLog:   at HaxeModuleRules.callHaxe (UnrealBuildTool.ModuleRules rules, HaxeCompilationInfo info, HaxeConfigOptions options) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at HaxeModuleRules.setupHaxeTarget (UnrealBuildTool.ModuleRules rules, Boolean forceHaxeCompilation, HaxeConfigOptions options) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at HaxeModuleRules.run () [0x00000] in <filename unknown>:0
CompilerResultsLog:   at BaseModuleRules..ctor (UnrealBuildTool.ReadOnlyTargetRules target) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at HaxeModuleRules..ctor (UnrealBuildTool.ReadOnlyTargetRules target) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at MyProject2..ctor (UnrealBuildTool.ReadOnlyTargetRules Target) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
CompilerResultsLog:   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
CompilerResultsLog:   --- End of inner exception stack trace ---
CompilerResultsLog:   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
CompilerResultsLog:   at UnrealBuildTool.RulesAssembly.CreateModuleRules (System.String ModuleName, UnrealBuildTool.ReadOnlyTargetRules Target, UnrealBuildTool.FileReference& ModuleFileName) [0x00000] in <filename unknown>:0
LogMainFrame: MainFrame: Module compiling took 2.797 seconds```
waneck commented 6 years ago

Hey, Matthew! By looking at this log, it seems that it cannot find a Haxe installation. I was wondering if you are building from the UI, while haxe is installed only through a path export that is added on bashrc.

You can certify if that's the issue by building directly through the command-line - something like path/to/Unreal/Engine/Build/BatchFiles/Mac/Build.sh MyProject2Editor Mac Development -project=/path/to/your/MyProject2.uproject . Let me know if this fixes it.

waneck commented 6 years ago

Closing this - no feedback. Feel free to reopen!