7

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.

Barry
  • 216
  • 1
  • 3
  • 13

4 Answers4

6

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

joel mora
  • 61
  • 1
2

my problem was the issue of the environment variable "JAVA_HOME", I updated to jdk 11, as it was in the latest jdk, after updating it fixed my problem

Daniel Bentes
  • 508
  • 4
  • 10
0

Just switched my java version to jdk 8 & worked for my case. Try Changing your jdk versions and find out which works the best. In my case, while using FVM(flutter version manager) , after a week I found that using jdk 8 was working for the older project I was working on despite newer java version worked for my newer projects but not for older projects.

borchvm
  • 3,533
  • 16
  • 44
  • 45
0

Maybe has another Java version in your computer. Gradle compatible with java reference. Upgrade gradle version to the supported Java version in your computer.

Cui Qing
  • 157
  • 2
  • 5