Could not initialize class org.codehaus.groovy.reflection.ReflectionCache Answer’s

The class org.codehaus.groovy.reflection.ReflectionCache could not be initialized. This may have occurred because the required class wasn't found or there was an error in its initialization.

Could not initialize class org.codehaus.groovy.vmplugin.VMPluginFactory

on Jan 01, 1970
On your Android or Intellij Project, go to:

yourprojectname/gradle/wrapper/gradle-wrapper.properties. 
Property distributionUrl should be: 

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

If it's an older version then change it, run ./gradlew clean build and try again.

Add Comment

0

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

on Jan 01, 1970
It's probably because you use Gradle as the build system and JDK14
and the Gradle version is old. Reference:

https://github.com/gradle/gradle/issues/10248

If you use Gradle Wrapper then refer to
$PROJECT_ROOT/gradle/wrapper/gradle-wrapper.properties.
Property distributionUrl should be: 

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

If it's an older version then change it, run ./gradlew clean build 
and try again.

Add Comment

0

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

on Jan 01, 1970
Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file:
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"

Add Comment

0

Answer for Could not initialize class org.codehaus.groovy.reflection.ReflectionCache in java show above: 

Java answers related to "Could not initialize class org.codehaus.groovy.reflection.ReflectionCache"

View All Java queries

Java queries related to "Could not initialize class org.codehaus.groovy.reflection.ReflectionCache"

Browse Other Code Languages

CodeProZone