Android Studio Could Not Initialize Class Org.Codehaus.Groovy.Runtime.Invokerhelper

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

I faced this issue because of lower version of Jdk.
Previously I installed Jdk 1.7 and Android Studio 1.5.1, I got this issue.
If you install Android Studio 1.5.1 or above JDK 1.8 required

So Installing JDK 1.8 solved this issue.

Gradle error: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

So from your repo, if you have gradle-wrapper.properties like this:

➜ cat gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

On first compilation, Gradle tells you that:

  build file '/Users/tim/Code/Java/brobotREST/build.gradle': 36:
all buildscript {} blocks must appear before any plugins {} blocks in the script

So if you move the buildscript section up to the top of the build.gradle file, it all seems to work

And I get:

➜ ./gradlew -version

------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 14 (Azul Systems, Inc. 14+36)
OS: Mac OS X 10.15.4 x86_64

How to solve (Could not initialize class org.codehaus.groovy.reflection.ReflectionCache) issue in react native

I had the same error on Mac OS and React Native v0.62.

Apply these instructions correctly: React native environment setup

Adding this variable solved my problem:

export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"

Suddenly I got this FAILURE when i run Flutter app on android studio Could not initialize class org.codehaus

Try changing your gradle version from 6.7 to 6.4, It worked for me.

Also run Flutter Doctor and check if certificates are accepted ( Sometimes we have to reaccept it again).



Related Topics



Leave a reply



Submit