Why can't I build my project? gradle error

Hi, this problem is becoming very annoying, for a week now I have been trying to solve it but had no success, I have tried every possible solution to solve it and got nothing :frowning:

So, every time I try to package my project I get this error:

BUILD FAILED in 23s
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): ERROR: C:\WINDOWS\system32\cmd.exe failed with args /c "C:\Users\Abdulrahman\Documents\Unreal Projects\PackTry2\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)):        (see C:\Users\Abdulrahman\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.22\Log.txt for full exception trace)
PackagingResults: Error: C:\WINDOWS\system32\cmd.exe failed with args /c "C:\Users\Abdulrahman\Documents\Unreal Projects\PackTry2\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,PVRTC,DXT,ATC,ETC2,ETC1)): BUILD FAILED
PackagingResults: Error: Unknown Error

My Project settings:

Solutions I have tried with no success:
1- Enable Gradle instead of Ant
2- Update: Android Support Repository
3- Download all tools from android.bat

Please help me I am struggling so much with this problem now…

Check this → Android packaging build fail - UE 4.18 - Mobile - Unreal Engine Forums

cheack out this

Just install different version of java development kit and change path in Android SDK tab to that new version in project settings.

That did the job for me.

1 Like

in [project]\Intermediate\Android\arm64\gradle\ i ran ./gradlew wrapper --gradle-version=8.3 (the gradle version should match with compatible java version). this is a temporary fix tho , any new projects might have same bug

1 Like