Android Packaging "Error: cmd.exe failed with args"

I’m having trouble packaging for Android. I get the same error every time. “PackagingResults: Error: cmd.exe failed with args /c “D:[PROJECT]\Intermediate/Android/APK\gradle\rungradle.bat” :app:assembleDebug”

This is a very frustrating error since I’ve packaged with all these settings before and even published my game to the Google Play Store, it just randomly stopped working. I’ll attach the full packaging log. Packaging log

I get the same error while running with ant as well. I’ve also reinstalled the Android SDK stuff. I’ve even tried merging my project into a blank one then attempting a package to no avail.

I have the same error, but I’ve found a temporary workaround → executing gradle from command line

  1. Start cmd.exe manually
  2. Cd "D:[PROJECT]\Intermediate/Android/APK\gradle"

  3. rungradle.bat :app:assembleDebug

This created the .apk file in the folder [PROJECT]\Binaries\Android

This step however doesn’t generate the installation file, so I’ve used the project settings to package the complete data into the .apk file.

Ok, the problem was in my JDK path in project settings. I used the JDK installed in “Program Files” folder, but after I changed the path to “E:/NVPACK/jdk1.8.0_77” it works fine. The problem was probably in the spaces in the path, try to use the paths without spaces.

I had a similar problem.

Solved by reinstalling the Android Studio, and doing all the required updates.

Best