Could not find class GradleWrapperMain

GradleWrapperMain

If you have a Gradle project like an Android app and want to do CI(Continuous integration) with any CI platforms like Jenkins, Gitlab CI etc, then most of the time script work smoothly but sometimes it drives you like nuts. One of the common problem is –

Problem

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Running after script...
End CI
ERROR: Build failed: exit status 1

 Solution

And the solution of this error is your project either doesn’t have gradle-wrapper.jar or you have missed it to add to you version control system tools like Git, Mercurial. Make sure you add the following files and directory into your project and into your version control system.

|---gradle
    |---wrapper
        |---gradle-wrapper.jar
        |---gradle-wrapper.properties

And you are done.

 

Do not forget to share it with your friends and colleagues.

Happy coding!!!

Leave a Reply

Your email address will not be published. Required fields are marked *