I just import an existing android project and wanted to run a gradle task from terminal.
But however I'm always getting following exception for this project:
java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
I saw already several answers to the same problem, but they don't really help me.
Just to be sure my Android Studio is working right, I tried to open another project. There everything worked fine. And on the first look all settings of the project are the same.
I didn't installed gradle on my mac but using default gradle wrapper of the android studio instead.
Maybe any of you have a solution?
A really stupid thing, but ... maybe it helpes someone else.
The gradle wrapper folder I've got didn't contain gradle-wrapper.jar
I'm not sure it's a right solution, but I added it manually from another project and now it works.
In case nothing else helps, for a similar issue I cleaned up (i.e. deleted) the folders .gradle\caches and .gradle\wrapper\dists. Seems like something was broken in there.
My original error message was "java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain" when trying to run the gradle wrapper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With