FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ASTC)): * What went wrong:
UATHelper: Packaging (Android (ASTC)): Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
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. Run with --scan to get full insights.
UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 2s
UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c “G:\UE\Falcoware\Check_Reaction\Check_Reaction\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleRelease
UATHelper: Packaging (Android (ASTC)): (see C:\Users\User\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+EpicGames+UE_4.25\Log.txt for full exception trace)
PackagingResults: Error: cmd.exe failed with args /c “G:\UE\Falcoware\Check_Reaction\Check_Reaction\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleRelease
I had this same problem and took me a while to find something that worked for me.
I’m using 4.25 and have a clean install of Android Studio and Java.
From reading the bug reports on the gradle github - seems that the solution is to download JDK v. 8 - I did this, repointed my Unreal settings to here - and then it worked smoothly.
Same Problem… (UE 4.26)
Solved it with this steps:
Download JDK v.8 and set it in UE Program Settings/ Platforms/ Android SDK - Location of JAVA - solved some errors but not all!
I notice that the UE auto NDK download has instaled NDK versión 21.1.6352462 - and in the UE docs (Updates to required setup for Android NDK 21 in Unreal Engine 4.25 - Unreal Engine) recoment 21.0.6113669
So i changed the NDK to 21.0.6113669 using already installed the Android Studio 3.5.3:
Open Android Studio
Configure
SDK Manager
SDK Tools
show Package Deteils
Install NDK 21.0.6113669
Open UE project:
Change the NDK versionfolder in your project UE Program Settings/ Platforms/ Android SDK - Locación of NDK 21.0.6113669
I have been trying for over four hours and still cant build a simple basic project. It is UNREAL and EPIC that an engine would require so many modifications just to start working. This software company is a joke.