i was using gradle-8.1.1, but build was getting failed with below error. someone please help on this… i tried changing to different versions, still no luck. deleted gradlew and its properties and regenerated… still same error.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
The Gradle wrapper consists of four files. I asked whether you have the jar file of the four, because that missing is the typical cause for that error.
have not changed anything related to gradle files, till last friday it was working fine… build was success… from monday onwards, this error occurs… build is getting failed with this error.
i tried downgrade/upgrade the gradle versions for testing, but no luck
please tell where am i wrong.
docker image used : alvrme/alpine-android:android-33-jdk17
Yes, those four.
Well something must have changed obviously.
Maybe modify the gradlew script so that it outputs the commandline executed to see whether there is something fishy.
Well, maybe I should stop using LLMs, because I’ve just run into a similar issue. Copilot generated a project for me with the following .gitignore content:
*.jar
*.war
*.ear
By the way, most related StackOverflow answers also point out a .gitignore problem.
Because most typically that is the problem.
Though not in this thread I’d say as it worked and suddenly stopped working.
Even if the .gitignore of OP contained *.jar that should not be a problem as the gradle-wrapper.jar file was already versioned and once a path is versioned, the .gitignore is ignored anyway for that path.
But yeah, a “bad” .gitignore can easily cause the same error as then the JAR is missing as suspected above unless you force-add it to the Git repository.