Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache when running gradlew.bat file

I am trying to run a gradlew.bat file via cmd and am running into the error:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

I tried following various solutions from this post to no avail. I tried changing the value in gradle-wrapper.properties from

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip

to

distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip

and ran again but was met with:

A problem occurred configuring root project 'nexus-deploy'.
> Could not open cp_proj remapped class cache for s5e1jtxdcnwfq13zlj7qke7c

I then tried removing the scripts + scripts-remapped folders from the gradle cache but that did nothing as well. Finally, I tried running

./gradlew clean

but got

   * What went wrong:
   A problem occurred configuring root project 'nexus-deploy'.
   Could not open cp_proj remapped class cache for s5e1jtxdcnwfq13zlj7qke7c

I'm not sure what is going wrong and don't know what else to try. I am on java version "1.8.0_341" and Gradle 7.5.1.

like image 897
Barry Avatar asked Feb 12 '26 13:02

Barry


1 Answers

check if jdk 18 is supported in Android. I am using jdk 11 and NDK 21.3

like image 54
joel mora Avatar answered Feb 14 '26 04:02

joel mora