I am getting this exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 and java.lang.NoClassDefFoundError: Coul
Check that your project is running with Java 14 even though it is prepared for Java 8.
My IntelliJ Idea was giving the same error when trying to execute a Gradle task which was running perfectly in command line with JDK 8. The ItelliJ Idea project default JDK was 14 though.
How do you run the application? 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.
This issue is solved for me only when I updated compileSdkVersion and targetSdkVersion to 30 with minSdkVersion 19
Got the same issue on a Maven & SpringBoot project, no Gradle whatever.
The dependency to org.codehaus.groovy is probably transitive through spring-cloud-contract-verifier. Run mvn dependency:tree
to view the whole dependency tree.
I got it fixed by upgrading the spring-cloud-contract-maven-plugin version to 2.2.3-RELEASE
I resolve this problem when integrated Facebook 7.19.2 and Google play Games 0.10.09.
In my case JDK and SDK using (and other in Edit/Preferences/External -> Tools-Android
) default paths Unity:
JDK
C:/ProgramFiles/Unity/Hub/Editor/2019.2.12f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows
SDK
C:/Program Files/Unity/Hub/Editor/2019.2.12f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK
In Environmental Variables(System Proporites/Advanced) added next:
Find(or click new variable under User Variables)
JAVA_HOME
and add root JDK path.
JAVA_BIN
and add path JDK/bin
JAVA_LIB
and add path JDK/lib
Also, add these paths in System Variables to variable "Path".
Do not use SDK from default Unity and JDK from not Unity default
Then Restart Unity(and better PC).
Then in Editor Unity - Assets/Play -> Service -> Resolve/Android -> Resolver/Force -> Resolve
All Work fine.
I solved it by just edit gradle-wrapper.properties inside gradle folder not .gradle :
from:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
to:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
rebuild and it's ok .