UE4.25.0 Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

Can help? Nothing suggested here helps https://answers.unrealengine.com/que…il-ue-418.html

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

Try to update to 4.25.1.
I had this error too and is something about UE4.25 using Gradle5.4 that depends on JDK8, if you install (or rollback to) JDK8 it will fix this error but will cause other problems.

4.26.0
still happening

In project settings => android. Try to set only x64.

fixed. I needed to set up the environment variables. such as Android sdk home, ant home etc from the tutorial

Can you please attach a screenshot of your environment variables?

Ok. So the issue here is that UE does not use the correct version of java. I have java11, java14 from oracle that mess things up.

UE must use correct home directories. (!!! if you have /etc/environment set it does not necceseraly mean that UE uses this directories)
ANDROID_HOME=“/home/wins/Android/Sdk”
ANT_HOME=“/usr/share/ant”
JAVA_HOME=“/home/wins/android-studio/jre”
NDKROOT=“/home/wins/Android/Sdk/ndk/21.1.6352462”

java -version
openjdk version “1.8.0_242-release”
OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
OpenJDK 64-Bit Server VM (build 25.242-b3-6222593, mixed mode)

ant -version
Apache Ant™ version 1.10.5 compiled on March 28 2019