# Cmd.exe failed with args: Rungradle.bat. Packaging for android

**URL:** <https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, UE4-26, question\
**Created:** [January 23, 2022, 1:02am UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281 "2022-01-23T01:02:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b3bc4d7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b3bc4d7a](https://forums.unrealengine.com/u/anonymous_user_b3bc4d7a)\
**Post date:** [January 23, 2022, 1:02am UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/1 "2022-01-23T01:02:23Z")

</div>

![UE4Pic1]()

I have been working all day trying to get my game onto google play. I created a keystore and everything stopped working. As you can see in the image, it says something about the game failing to read the keystore (I did everything the ue4 doc said to do, but the command prompt didn’t give me a key password, just a key_store_ password). And it also says something about failed with args at rungradle.bat, and I’ve actually had this problem before. I solved it by turning my security off because my computer was blocking the package from working, but I did this time and it still won’t work. I’m using UE4 4.26, just as an FYI. Everything worked fine until I messed around with the keystore, and I’m very confused on how to move forward. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [January 23, 2022, 10:22am UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/2 "2022-01-23T10:22:21Z")

</div>

1. ![Screenshot_46]()  
2. ![Screenshot_47]()  
3. ![Screenshot_48]()

```auto
keytool -genkey -v -keystore ExampleKey.keystore -alias MyKey -keyalg RSA -keysize 2048 -validity 10000

```

1. enter your details there it says what need ![Screenshot_49]()
2. move the generated key to the folder with your game  
 ![Screenshot_50]()
3. the password must be the one you entered when generating the key  
 ![Screenshot_52]()

//it’s the whole process)) where you make a mistake you can look … I uploaded in the play market there were no problems … of course you may have a different project name or java location or key name))

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b3bc4d7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b3bc4d7a](https://forums.unrealengine.com/u/anonymous_user_b3bc4d7a)\
**Post date:** [January 23, 2022, 10:33pm UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/3 "2022-01-23T22:33:29Z")

</div>

I didn’t have the setting set to shipping, so I changed that. And I did the process you showed, but it still gives me the same error messages, I have JDK 16.0.2 if that makes a difference. It also still didn’t give me a _key_ password, just a _keystore_ password. But thank you for your help 🙂.  
Here is the log after the cmd.exe failed with args line (Sorry, wasn’t able to get the full log, it’s super long):  
 ![UE4Pic2]()

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [January 24, 2022, 9:22am UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/4 "2022-01-24T09:22:00Z")

</div>

that’s your problem JDK! install  
 ![Screenshot_6]()  
 ![Screenshot_7]()  
 ![Screenshot_8]()

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [January 24, 2022, 6:53pm UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/5 "2022-01-24T18:53:38Z")

</div>

> [@anonymous\_user\_b3bc4d7a](#):
>
> It also still didn’t give me a _key_ password, just a _keystore_ password

I don’t understand it a bit …  
here are the instructions of the epic … set the correct java and try

> **[Signing Projects for Release](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/DistributionSigning/)**
>
> Getting your project ready to be release to the Google Play store.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b3bc4d7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b3bc4d7a](https://forums.unrealengine.com/u/anonymous_user_b3bc4d7a)\
**Post date:** [January 24, 2022, 10:14pm UTC](https://forums.unrealengine.com/t/cmd-exe-failed-with-args-rungradle-bat-packaging-for-android/274281/6 "2022-01-24T22:14:25Z")

</div>

Yeeessss, it works now! When I said it wasn’t giving me a _key_ password, but it was giving me a _keystore_ password, this is what I meant:  
 ![UE4Pic3]()  
I got the prompt this time. Everything’s working good now. Thank you!
