# ERROR: cmd.exe failed with args

**URL:** <https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679>\
**Category:** Platform & Builds\
**Tags:** error, unreal-engine, build-failed, question\
**Created:** [January 20, 2019, 11:38am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679 "2019-01-20T11:38:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_084be11c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_084be11c](https://forums.unrealengine.com/u/anonymous_user_084be11c)\
**Post date:** [January 20, 2019, 11:38am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/1 "2019-01-20T11:38:53Z")

</div>

Hi,  
i got a build error for android

UATHelper: Packaging (Android (ATC)): ERROR: cmd.exe failed with args /c “D:\unrealtest\m1\Intermediate/Android/APK\gradle\rungradle.bat” :app:assembleDebug

UATHelper: Packaging (Android (ATC)): (see C:\Users\ABRA\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE\_4.21\Log.txt for full exception trace)

UATHelper: Packaging (Android (ATC)): AutomationTool exiting with ExitCode=1 (Error\_Unknown)

UATHelper: Packaging (Android (ATC)): BUILD FAILED  
PackagingResults: Error: cmd.exe failed with args /c “D:\unrealtest\m1\Intermediate/Android/APK\gradle\rungradle.bat” :app:assembleDebug  
PackagingResults: Error: Unknown Error

---

<div class="post-metadata">

**Author:** ![vladimirgiraldo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vladimirgiraldo](https://forums.unrealengine.com/u/vladimirgiraldo)\
**Post date:** [January 30, 2019, 5:10pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/2 "2019-01-30T17:10:34Z")

</div>

Hi…

Try unchecking the “Enable Gradle instead of Ant” checkbox in Project Settings.

 ![267024-disable-gradle.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/2/882d92ee58f0244ab2762c2b2da282bd84a64fdb.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b84061fe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b84061fe](https://forums.unrealengine.com/u/anonymous_user_b84061fe)\
**Post date:** [January 30, 2019, 5:33pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/3 "2019-01-30T17:33:45Z")

</div>

I’m having the same problem. Just updated UE to 4.21 and reinstalled the NVPACK to Codeworks 1R7 as given in the UE Engine Folder…  
If you take a look at some lines above, it says (at least for me):

```
UATHelper: Packaging (Android (ASTC)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ASTC)): * What went wrong:
UATHelper: Packaging (Android (ASTC)): A problem occurred configuring project ':app'.
UATHelper: Packaging (Android (ASTC)): > You have not accepted the license agreements of the following SDK components:
UATHelper: Packaging (Android (ASTC)): [Android SDK Build-Tools 26.0.2].
UATHelper: Packaging (Android (ASTC)): Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
UATHelper: Packaging (Android (ASTC)): Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
UATHelper: Packaging (Android (ASTC)): * Try:
UATHelper: Packaging (Android (ASTC)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 14s
UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c "D:\TJProjects\SPF\Special Police Forces 4.20\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleRelease
UATHelper: Packaging (Android (ASTC)): (see C:\Users\\Roaming\Unreal Engine\AutomationTool\Logs\D+Programme+Epic+Games+UE_4.21\Log.txt for full exception trace)
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ASTC)): BUILD FAILED
PackagingResults: Error: Unknown Error

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b84061fe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b84061fe](https://forums.unrealengine.com/u/anonymous_user_b84061fe)\
**Post date:** [January 30, 2019, 5:51pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/4 "2019-01-30T17:51:49Z")

</div>

Found a solution:

As enabling ANT instead of gradle gave me the same problem and all licences were already checked, I found an other solution:

1. Go to _NVPACK\android-sdk-windows\tools_ and run _android.bat_ to execute the SDK-Manager (not the CodeWorks Manager)

2. If anything is checked, deselect everything.

3. Uninstall any installed _Android SDK Build-tools_

4. Now install the _Android SDK Build-tools_ with latest Revision (at the moment _Rev. 28.0.3_)

I also updated the _Android SDK Tools_ and _Android SDK Platform-tools_

 ![267026-sdk-manager.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/9/d895633bc06bb2166807a7889fe8a373592573cf.jpeg)

Now rebuild your Project and it should work without any errors!  
Hope this is helpful

---

<div class="post-metadata">

**Author:** ![SpaceCat86](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spacecat86/32/634357_2.png) [@SpaceCat86](https://forums.unrealengine.com/u/SpaceCat86)\
**Post date:** [March 30, 2019, 10:08pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/5 "2019-03-30T22:08:33Z")

</div>

Thank you so much for sharing this! it fixed my problem.

---

<div class="post-metadata">

**Author:** ![Cervelx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cervelx](https://forums.unrealengine.com/u/Cervelx)\
**Post date:** [May 5, 2019, 12:43pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/6 "2019-05-05T12:43:14Z")

</div>

You saved me !!! Thanks !!!

---

<div class="post-metadata">

**Author:** ![NEON1time](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NEON1time](https://forums.unrealengine.com/u/NEON1time)\
**Post date:** [May 20, 2019, 1:33pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/7 "2019-05-20T13:33:54Z")

</div>

how do you rebuild your project?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_451ef1c5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_451ef1c5](https://forums.unrealengine.com/u/anonymous_user_451ef1c5)\
**Post date:** [June 10, 2019, 6:19pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/8 "2019-06-10T18:19:49Z")

</div>

Not working for me. I update tools and platforms as well. But the same error.  
ERROR: ERROR: cmd.exe failed with args

---

<div class="post-metadata">

**Author:** ![Saaaaaaaaaamm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Saaaaaaaaaamm](https://forums.unrealengine.com/u/Saaaaaaaaaamm)\
**Post date:** [July 9, 2019, 9:43am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/9 "2019-07-09T09:43:39Z")

</div>

From July 2019  
Dont use build tools Rev.29 or later,Rev.28 is OK.  
不要使用Rev29或者以后的版本，会出现相同的问题。

---

<div class="post-metadata">

**Author:** ![Gerigory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gerigory](https://forums.unrealengine.com/u/Gerigory)\
**Post date:** [October 31, 2019, 1:33pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/10 "2019-10-31T13:33:08Z")

</div>

thx, it works for me

---

<div class="post-metadata">

**Author:** ![Kwixb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kwixb](https://forums.unrealengine.com/u/Kwixb)\
**Post date:** [May 31, 2020, 6:17pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/11 "2020-05-31T18:17:32Z")

</div>

I am getting a similar in 4.24 but the Enable Gradle instead of Ant option is missing in my version

---

<div class="post-metadata">

**Author:** ![SculptorM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SculptorM](https://forums.unrealengine.com/u/SculptorM)\
**Post date:** [October 17, 2020, 5:35pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/12 "2020-10-17T17:35:21Z")

</div>

I know this is a later version, but wanted to share since these posts appeared in my search for a solution: I had this problem with 4.25 for a week, trying on two laptops with zero success. Found this video , titled: UNREAL ENGINE 4.25.1 PACKAGING FOR ANDROID TUTORIAL UPDATED! : [UNREAL ENGINE 4.25.1 PACKAGING FOR ANDROID TUTORIAL UPDATED! - YouTube](https://www.youtube.com/watch?v=4SY2Za6j7UY)

I removed all of the files for android studio and codeworks (which took some work for some reason) and started with this process from scratch, also installing JDK 15 fresh.

It worked. The “cmd.exe failed with args /c” failure is gone. I hope this works for you. I spent a week looking for the answer, and this 20 minute step-by-step setup solved the problem.

side note: my desktop system has not had this issue at all, and is still set up differently, for some reason the laptops would not work unless this exact setup is in place.

---

<div class="post-metadata">

**Author:** ![kreshnov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kreshnov](https://forums.unrealengine.com/u/kreshnov)\
**Post date:** [December 13, 2020, 2:23am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/13 "2020-12-13T02:23:28Z")

</div>

What eventually fixed it for me was deleting the Intermediate folder and then relaunching the project.

Found the answer here:

> **[UE4：cmd.exe failed with args /c...](https://www.programmersought.com/article/82301391971/)**
>
> UE4：cmd.exe failed with args /c “\[ProjectPath\]\\Intermediate/Android/APK\\gradle\\rungradle.bat”, Programmer Sought, the best programmer technical posts sharing site.

---

<div class="post-metadata">

**Author:** ![kevin114987](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kevin114987](https://forums.unrealengine.com/u/kevin114987)\
**Post date:** [December 16, 2020, 2:04pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/14 "2020-12-16T14:04:10Z")

</div>

I had this problem, for me I had to increase the heap size.

Go to: Unreal[PROJECTNAME]\Intermediate\Android\armv7\gradle  
Open: gradle.properties with notepad or other textwriter  
Change: org.gradle.jvmargs=- **XX:MaxHeapSize** =4096m -Xmx9216m To somthing like XX:MaxHeapSize=8096

Hope this helped.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f1b9bc4b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f1b9bc4b1](https://forums.unrealengine.com/u/anonymous_user_f1b9bc4b1)\
**Post date:** [December 20, 2020, 6:52pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/15 "2020-12-20T18:52:49Z")

</div>

I set location of java in ANDROID SDK to C:/NVPACK/jdk1.8.0\_77/jre and it worked.

---

<div class="post-metadata">

**Author:** ![Zotabreu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zotabreu](https://forums.unrealengine.com/u/Zotabreu)\
**Post date:** [December 24, 2020, 8:46pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/16 "2020-12-24T20:46:49Z")

</div>

its worked for me. thanks

---

<div class="post-metadata">

**Author:** ![VeganApps](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/veganapps/32/1198354_2.png) [@VeganApps](https://forums.unrealengine.com/u/VeganApps)\
**Post date:** [February 14, 2021, 3:20pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/17 "2021-02-14T15:20:21Z")

</div>

Also got the “ERROR: cmd.exe failed with args /c” with version 4.26.1 and I fixed it by simply deleting the content of the ProjectName/Intermediate folder. xD

---

<div class="post-metadata">

**Author:** ![G1PARK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@G1PARK](https://forums.unrealengine.com/u/G1PARK)\
**Post date:** [March 7, 2021, 9:14am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/18 "2021-03-07T09:14:02Z")

</div>

This is the simplest and the best solution for me  
Thank you~!

---

<div class="post-metadata">

**Author:** ![Samush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Samush](https://forums.unrealengine.com/u/Samush)\
**Post date:** [April 9, 2021, 12:17am UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/20 "2021-04-09T00:17:20Z")

</div>

I’ve fixed it by deleting the Intermediate/Anrdoid/arm7 (or gradle) folder, even sometimes deleting just the gradle.bat file.

---

<div class="post-metadata">

**Author:** ![KonPetTsu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KonPetTsu](https://forums.unrealengine.com/u/KonPetTsu)\
**Post date:** [May 18, 2021, 4:44pm UTC](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679/21 "2021-05-18T16:44:56Z")

</div>

For newest intallations use solution from

> [@4.26.1 - Android Export Error](https://forums.unrealengine.com/t/4-26-1-android-export-error/212728/8):
>
> sometimes you will need to install all the android and jre stuff before installing unreal engine

jdk-8u291-windows-x64 ( jre1.8.0\_291 ) from Java SE Development Kit 8 - Downloads  
+  
android-ndk-r21e from NDK Revision History | Android NDK | Android Developers

[Next page](https://forums.unrealengine.com/t/error-cmd-exe-failed-with-args/441679.md?page=2)
