Android packaging failed Automation.dll

I downloaded the source code version of the unreal engine and tried to package an empty project but this error message pops up. I can package the project in official installed version of unreal but I need some modification with the media player. I opened the project with debug-> start a new instance in visual studio.

MainFrameActions: Packaging (Android (ETC2)): CSC : error CS2012: Cannot open ‘C:\Users\Mik\Documents\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\obj\Development\AutomationUtils.Automation.dll’ for writing – ‘The process cannot access the file ‘C:\Users\Mik\Documents\Git
MainFrameActions: Packaging (Android (ETC2)): Hub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\obj\Development\AutomationUtils.Automation.dll’ because it is being used by another process.’ [C:\Users\Mik\Documents\GitHub\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj]
MainFrameActions: Packaging (Android (ETC2)): RunUAT.bat ERROR: AutomationTool failed to compile.
MainFrameActions: Packaging (Android (ETC2)): BUILD FAILED

Hello,

The reason that you are seeing this error is because you are attempting to package the game while running the editor in Debug through Visual Studio. Instead, you should build the project in Visual Studio, and then open the .uproject file and package it from there. If you run in Debug, you will not be able to package the game successfully.

Have a great day

This fixed it for me too. Funny thing was that I had successfully packaged nearly 30 versions of my game through the engine launched in Debug in Visual Studio before it stopped working after a reboot. Go figure.

@sean , i need to debug the process of cooking thats why i was trying to start the cooking process in debug mode but i failed with same error.
so what could be the proper steps of debuging cooking process?

Have you tried looking through the output log to see what errors you are getting in there? Typically, that is how we debug any packaging/cooking issues. Looking through the log often yields detailed errors that you can resolve, or look up on Google to find a resolution for.