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

**URL:** <https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [June 4, 2020, 1:53pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110 "2020-06-04T13:53:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![IDiZuI](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IDiZuI](https://forums.unrealengine.com/u/IDiZuI)\
**Post date:** [June 4, 2020, 1:53pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/1 "2020-06-04T13:53:06Z")

</div>

Can help? Nothing suggested here helps [https://answers.unrealengine.com/que…il-ue-418.html](https://answers.unrealengine.com/questions/720605/android-packaging-build-fail-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](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

---

<div class="post-metadata">

**Author:** ![DarknessFX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/darknessfx/32/1194676_2.png) [@DarknessFX](https://forums.unrealengine.com/u/DarknessFX)\
**Post date:** [June 4, 2020, 8:29pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/2 "2020-06-04T20:29:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_593e49ac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_593e49ac](https://forums.unrealengine.com/u/anonymous_user_593e49ac)\
**Post date:** [March 11, 2021, 5:06pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/3 "2021-03-11T17:06:21Z")

</div>

4.26.0  
still happening

---

<div class="post-metadata">

**Author:** ![IDiZuI](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IDiZuI](https://forums.unrealengine.com/u/IDiZuI)\
**Post date:** [March 17, 2021, 8:17am UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/4 "2021-03-17T08:17:49Z")

</div>

> [@anonymous\_user\_593e49ac](#):
>
> 4.26.0  
> still happening

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_593e49ac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_593e49ac](https://forums.unrealengine.com/u/anonymous_user_593e49ac)\
**Post date:** [April 3, 2021, 11:33am UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/5 "2021-04-03T11:33:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NayamAmarshe](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nayamamarshe/32/88710_2.png) [@NayamAmarshe](https://forums.unrealengine.com/u/NayamAmarshe)\
**Post date:** [April 15, 2021, 8:58pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/6 "2021-04-15T20:58:59Z")

</div>

Can you please attach a screenshot of your environment variables?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_593e49ac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_593e49ac](https://forums.unrealengine.com/u/anonymous_user_593e49ac)\
**Post date:** [April 16, 2021, 8:26pm UTC](https://forums.unrealengine.com/t/ue4-25-0-could-not-initialize-class-org-codehaus-groovy-reflection-reflectioncache/145110/7 "2021-04-16T20:26:24Z")

</div>

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
