Cooked failed with UnrealFrontEnd. Unable to load module

I have recompiled the source code of version 4.16.1

When I try to Cook, it fails with the message

Cook: LogModuleManager:Warning: ModuleManager: Unable to load module ‘D:/KadeoGames/UDK/KSGM/Binaries/Win64/UE4Editor-KSGM.dll’ because the file couldn’t be loaded by the OS.

I can load the project within the Editor. In version 4.15.3 it was working without any problem.

The log:
link text

I have no idea why it cannot load the UE4Editor-KSGM.dll since when you launch the editor, it loads the dll.

Another problem is due to a class.

UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Fatal error: [File:D:\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 651]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Attempt to process /Script/KSGM/KDamageType before it has been added.

The class is very simple and I don’t why this error.

UENUM(BlueprintType)
enum class EKDamageTypeEnum : uint8
{
	KDT_Orange		 			UMETA(DisplayName = DKT_GEN_HELIUMORANGE),		// 0
	KDT_Yellow				 	UMETA(DisplayName = DKT_GEN_NEONYELLOW),		// 1
	KDT_Blue	 				UMETA(DisplayName = DKT_GEN_ARGONBLUE),			// 2
	KDT_Gold				 	UMETA(DisplayName = DKT_GEN_KRYPTONGOLD),		// 3
	KDT_Purple				 	UMETA(DisplayName = DKT_GEN_XENONPURPLE),		// 4
	KDT_Red					 	UMETA(DisplayName = DKT_GEN_RADONRED),			// 5
	KDT_Green				 	UMETA(DisplayName = DKT_GEN_NEUTRALGREEN),		// 6
	KDT_Max					 	UMETA(Hidden)									// count = 7
};


// DamageType class that specifies type of damage
UCLASS(const, Blueprintable, BlueprintType)
class UKDamageType : public UDamageType
{
	GENERATED_UCLASS_BODY()

	/** physical damage ? */
	UPROPERTY(EditDefaultsOnly, Category = Damage)
	bool Physical;

	/** this damage type */
	UPROPERTY(EditDefaultsOnly, Category = Damage)
	EKDamageTypeEnum Type;

	/** force feedback effect to play on a player hit by this damage type */
	UPROPERTY(EditDefaultsOnly, Category=Effects)
	class UForceFeedbackEffect *HitForceFeedback;

	/** force feedback effect to play on a player killed by this damage type */
	UPROPERTY(EditDefaultsOnly, Category=Effects)
	class UForceFeedbackEffect *KilledForceFeedback;
};


#include "KSGM.h"
#include "KDamageType.h"


UKDamageType::UKDamageType(const FObjectInitializer& ObjectInitializer) 
	: Super(ObjectInitializer)
{
	// By default
	Physical = true;
	Type = EKDamageTypeEnum::KDT_Max;
}



LogSourceControl: Attempting 'p4 fstat -Or D:/KadeoGames/UDK/KSGM/Content/Maps/R-Training1.umap'
Cmd: OBJ SAVEPACKAGE PACKAGE="/Game/Maps/R-Training1" FILE="../../../../../KadeoGames/UDK/KSGM/Content/Maps/R-Training1.umap" SILENT=true AUTOSAVING=false KEEPDIRTY=false
LogSavePackage: Save=1190.06ms
LogSavePackage: Moving '../../../../../KadeoGames/UDK/KSGM/Saved/R-Training15F6329A940B7E79867C82B94E0643952.tmp' to '../../../../../KadeoGames/UDK/KSGM/Content/Maps/R-Training1.umap'
LogSavePackage:Display: Finished SavePackage ../../../../../KadeoGames/UDK/KSGM/Content/Maps/R-Training1.umap
LogFileHelpers: Saving map 'R-Training1' took 1.704
UATHelper: Packaging (Windows (64-bit)): Running AutomationTool...
UATHelper: Packaging (Windows (64-bit)): Automation.ParseCommandLine: Parsing command line: -ScriptsForProject=D:/KadeoGames/UDK/KSGM/KSGM.uproject BuildCookRun -nocompileeditor -nop4 -project=D:/KadeoGames/UDK/KSGM/KSGM.uproject -cook -stage -archive -archivedirectory=D:/KadeoGames/UDK/Packages/Game -package -clientconfig=DebugGame -ue4exe=UE4Editor-Cmd.exe
 -pak -prereqs -nativizeAssets -targetplatform=Win64 -build -CrashReporter -utf8output -compile
UATHelper: Packaging (Windows (64-bit)): ScriptCompiler.FindAndCompileScriptModules: Compiling scripts.
UATHelper: Packaging (Windows (64-bit)): MSBuild:   DotNETUtilities -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\DotNETUtilities.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   UnrealBuildTool -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AutomationUtils.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationUtils.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AllDesktop.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\AllDesktop\AllDesktop.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Localization.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\Localization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   OneSkyLocalization.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\OneSkyLocalization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   AutomationScripts.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\AutomationScripts.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Android.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\Android\Android.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   BuildGraph.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\BuildGraph.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   HTML5.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\HTML5\HTML5.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   MobileDeviceInterface -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\IOS\MobileDeviceInterface.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   IOS.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\IOS\IOS.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Linux.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\Linux\Linux.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Mac.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\Mac\Mac.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   TVOS.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\TVOS\TVOS.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   Win.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\Win.Automation.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   XLocLocalization.Automation -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\AutomationScripts\XLocLocalization.Automation.dll
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 2.4355176s to run MSBuild.exe, ExitCode=0
UATHelper: Packaging (Windows (64-bit)): BuildCookRun.SetupParams: Setting up ProjectParams for D:\KadeoGames\UDK\KSGM\KSGM.uproject
UATHelper: Packaging (Windows (64-bit)): Project.Build: ********** BUILD COMMAND STARTED **********
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe D:/GitHub/UnrealEngine/Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj /verbosity:minimal /nologo /target:Rebuild /property:Configuration=Development /property:Platform=AnyCPU
UATHelper: Packaging (Windows (64-bit)): MSBuild:   DotNETUtilities -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\DotNETUtilities.dll
UATHelper: Packaging (Windows (64-bit)): MSBuild:   UnrealBuildTool -> D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 1.0965021s to run MSBuild.exe, ExitCode=0
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe BootstrapPackagedGame Win64 Shipping  -NoUBTMakefiles  -noxge -generatemanifest -NoHotReload
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 4.4219998s to run UnrealBuildTool.exe, ExitCode=0
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: D:\GitHub\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe BootstrapPackagedGame Win64 Shipping  -NoUBTMakefiles  -noxge -NoHotReload -ignorejunk
UATHelper: Packaging (Windows (64-bit)): UnrealBuildTool: Target is up to date
UATHelper: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 0.58 seconds (NoActionsToExecute executor: 0.00 seconds)
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 0.7619981s to run UnrealBuildTool.exe, ExitCode=0
UATHelper: Packaging (Windows (64-bit)): Project.Build: ********** BUILD COMMAND COMPLETED **********
UATHelper: Packaging (Windows (64-bit)): Project.Cook: ********** COOK COMMAND STARTED **********
UATHelper: Packaging (Windows (64-bit)): CommandUtils.RunCommandlet: Running UE4Editor Cook for project D:\KadeoGames\UDK\KSGM\KSGM.uproject
UATHelper: Packaging (Windows (64-bit)): CommandUtils.RunCommandlet: Commandlet log file is D:\GitHub\UnrealEngine\Engine\Programs\AutomationTool\Saved\Cook-2017.06.07-17.38.36.txt
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: D:\GitHub\UnrealEngine\Engine\Binaries\Win64\UE4Editor-Cmd.exe D:\KadeoGames\UDK\KSGM\KSGM.uproject -run=Cook  -NoLogTimes -TargetPlatform=WindowsNoEditor -fileopenlog -unversioned -NativizeAssets="D:\KadeoGames\UDK\KSGM\Intermediate\Plugins\<PLAT>\NativizedAssets\NativizedAssets.uplugin" -abslo
g=D:\GitHub\UnrealEngine\Engine\Programs\AutomationTool\Saved\Cook-2017.06.07-17.38.36.txt -stdout -CrashForUAT -unattended  -UTF8Output
UATHelper: Packaging (Windows (64-bit)): Cook: LogInit:Display: Running engine for game: KSGM
UATHelper: Packaging (Windows (64-bit)): Cook: LogInit:Display: RandInit(496322801) SRandInit(496322801).
UATHelper: Packaging (Windows (64-bit)): Cook: LogOnline:Warning: Kadeo Subsystem disabled!
UATHelper: Packaging (Windows (64-bit)): Cook: LogOnline:Display: FOnlineSubsystemKadeo::Shutdown()
UATHelper: Packaging (Windows (64-bit)): Cook: LogOnline:Display: OSS: FOnlineSubsystemNull::Shutdown()
UATHelper: Packaging (Windows (64-bit)): Cook: LogShaderCompilers:Display: Using Local Shader Compiler.
UATHelper: Packaging (Windows (64-bit)): Cook: LogDerivedDataCache:Display: Max Cache Size: 512 MB
UATHelper: Packaging (Windows (64-bit)): Cook: LogDerivedDataCache:Display: Loaded Boot cache: ../../../../../KadeoGames/UDK/KSGM/DerivedDataCache/Boot.ddc
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP AllDesktopTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP MacClientTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP MacNoEditorTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP MacServerTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP MacTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP WindowsClientTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP WindowsServerTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP WindowsTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP AndroidTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_ATCTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_DXTTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_MultiTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP HTML5TargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP IOSTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTemp:Display: Loaded TP TVOSTargetPlatform
UATHelper: Packaging (Windows (64-bit)): Cook: LogTargetPlatformManager:Display: Building Assets For WindowsNoEditor
UATHelper: Packaging (Windows (64-bit)): Cook: LogModuleManager:Warning: ModuleManager: Unable to load module 'D:/KadeoGames/UDK/KSGM/Binaries/Win64/UE4Editor-KSGM.dll' because the file couldn't be loaded by the OS.
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: begin: stack for UAT
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: === Critical error: ===
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Fatal error: [File:D:\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 651] 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Attempt to process /Script/KSGM/KDamageType before it has been added.
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!UObjectBaseUtility::GetFullName() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectbaseutility.cpp:81]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!FUObjectArray::IsValid() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectarray.cpp:288]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!UObject::ConditionalBeginDestroy() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\obj.cpp:832]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!StaticExit() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\obj.cpp:4156]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\github\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1027]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!TBaseMulticastDelegate<void>::Broadcast() [d:\github\unrealengine\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!FEngineLoop::AppPreExit() [d:\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:3761]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!FEngineLoop::Exit() [d:\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2721]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!GuardedMain() [d:\github\unrealengine\engine\source\runtime\launch\private\launch.cpp:177]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!GuardedMainWrapper() [d:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!WinMain() [d:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: KERNEL32.DLL!0x0000000096D92774
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: ntdll.dll!0x0000000098AA0D61
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: ntdll.dll!0x0000000098AA0D61
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: end: stack for UAT
UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 31.102078s to run UE4Editor-Cmd.exe, ExitCode=-1073741819
UATHelper: Packaging (Windows (64-bit)): Project.Cook: Cook failed. Deleting cooked data.
UATHelper: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Cook failed. ---> AutomationTool.CommandletException: BUILD FAILED: Failed while running Cook for D:\KadeoGames\UDK\KSGM\KSGM.uproject; see log D:\GitHub\UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\Cook-2017.0
6.07-17.39.07.txt
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UE4Exe, String Commandlet, String Parameters) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 407
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.CommandUtils.CookCommandlet(FileReference ProjectName, String UE4Exe, String[] Maps, String[] Dirs, String InternationalizationPreset, String[] CulturesToCook, String TargetPlatform, String Parameters) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.
cs:line 112
UATHelper: Packaging (Windows (64-bit)):    at Project.Cook(ProjectParams Params) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 408
UATHelper: Packaging (Windows (64-bit)):    --- End of inner exception stack trace ---
UATHelper: Packaging (Windows (64-bit)):    at Project.Cook(ProjectParams Params) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 423
UATHelper: Packaging (Windows (64-bit)):    at BuildCookRun.DoBuildCookRun(ProjectParams Params) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 208
UATHelper: Packaging (Windows (64-bit)):    at BuildCookRun.ExecuteBuild() in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 40
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.BuildCommand.Execute() in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 100
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 566
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.Automation.Process(String[] Arguments) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 536
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.Program.MainProc(Object Param) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 133
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param) in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 704
UATHelper: Packaging (Windows (64-bit)):    at AutomationTool.Program.Main() in D:\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 57
UATHelper: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
UATHelper: Packaging (Windows (64-bit)): BUILD FAILED
PackagingResults:Error: Error Unknown Cook Failure

I don’t know what changed in 4.16.1
In 4.15.3 it was working.

Even with the 4.16.2 from source code. Packaging failed.

UATHelper: Packaging (Windows (64-bit)): Cook: LogTargetPlatformManager:Display: Building Assets For WindowsNoEditor
UATHelper: Packaging (Windows (64-bit)): Cook: LogModuleManager:Warning: ModuleManager: Unable to load module 'D:/KadeoGames/UDK/KSGM/Binaries/Win64/UE4Editor-KSGM.dll' because the file couldn't be loaded by the OS.
UATHelper: Packaging (Windows (64-bit)): Cook: LogUObjectArray:Warning: Invalid object index -572662307
UATHelper: Packaging (Windows (64-bit)): Cook: LogUObjectArray:Warning: Invalid object index -572662307


    UATHelper: Packaging (Windows (64-bit)): Cook: LogUObjectArray:Warning: Invalid object index -572662307
    UATHelper: Packaging (Windows (64-bit)): Cook: LogUObjectArray:Warning: Invalid object index 6619242
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: begin: stack for UAT
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: === Critical error: ===
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Fatal error: [File:D:\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 651] 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Attempt to process /Script/KSGM/KDamageType before it has been added.
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!UObject::ConditionalBeginDestroy() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\obj.cpp:845]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!StaticExit() [d:\github\unrealengine\engine\source\runtime\coreuobject\private\uobject\obj.cpp:4156]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\github\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1027]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!TBaseMulticastDelegate<void>::Broadcast() [d:\github\unrealengine\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!FEngineLoop::AppPreExit() [d:\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:3761]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!FEngineLoop::Exit() [d:\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2721]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!GuardedMain() [d:\github\unrealengine\engine\source\runtime\launch\private\launch.cpp:177]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!GuardedMainWrapper() [d:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!WinMain() [d:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: UE4Editor-Cmd.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: KERNEL32.DLL!0x0000000096D92774
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: ntdll.dll!0x0000000098AA0D61
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: ntdll.dll!0x0000000098AA0D61
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: 
    UATHelper: Packaging (Windows (64-bit)): Cook: LogWindows:Error: end: stack for UAT
    UATHelper: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 43.1768783s to run UE4Editor-Cmd.exe, ExitCode=255

Same message Unable to load module … because the file couldn’t be loaded by the OS.

Anyone has an idea. I’m stuck and cannot continue since I cannot cook to test.
Txs for your help.

I’m having the same issue. I just upgrade a project from 4.15 to 4.16 and I can’t pack it for Android. The project also loads for me, this issue only happens when I’m packing.

Also a little lost here, I’m not sure exactly where to look to find more info

I wanted to see if some other issues were fixed on 4.16 so I’ll try to dig deeper. Will keep you posted if I find anything.

Ok @domzorg, I managed to find the issue on my end. It was a plugin dll that my project dll was trying to access. It was looking everywhere but not in the plugin binary folder. I manually copied the dll to the same folder where my project dll was, and it worked. So the proper fix was to upgrade the plugin to 4.16 to make sure it would have it’s bin path on the include folders.

To get to that, I first got the error code when loading the dll, like this:

	DWORD ErrNo = GetLastError();
	UE_LOG(LogTemp, Warning, TEXT("LastError when loading = %d"),
		ErrNo);

In WindowsPlatformProcess.cpp:82.

I was getting the error code 126. Dug around and apparently, this happens by a number of reasons, including missing dependencies.

So I used the Process Monitor to see exactly what Windows was trying to read and when (download link:
http://technet.microsoft.com/en-us/sysinternals/bb896645).

Try to capture when you’re about to get the error. Stop capturing after the error appears and search for your dll’s name starting from the bottom. That’s how I saw that it was trying to read one of my project’s plugin immediately after reading the project dll.

Try to make those steps if you have the time and let me know if it also works for you.

I switched back to 4.15 since I found no solution for this.

I have to check if the project is using plugins.
I’ll try using the Process Monitor and let you know.

Txs.

Is someone using Gamesparks by any chance? I’ve commented any reference to it in our code and it cooked.

I’ve tried to track what dll are loaded and did not find any problem.
I’ve checked the version of all dlls in the Engine folder and subfolders and all are in 4.16.2
I’ve added debug log in int32 FWindowsPlatformProcess::GetDllApiVersion( const TCHAR* Filename )
and no error.

link text

It should be something else.
I’m going back to 4.15.3
Txs for your hints.

D.

I’m not using it.

In our case, removing the line “EngineVersion” from the .uplugin file solved the problem. If you know what plugin is causing the problem you may want to give a try to that.

@domzorg, did you check the process monitor to find what DLL unreal is trying to load right after it loads UE4Editor-KSGM.dll? Can you post a screenshot of what you got?

This is the log of the Process Monitor.

link text

I’ve added more log for the cooking process.
Several dlls cannot be found.

link text

Finally solved.
See link text