Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
The Gradle wrapper JAR (gradle/wrapper/gradle-wrapper.jar) is missing or corrupt.
Could not find or load main class org.gradle.wrapper.GradleWrapperMain Meaning
gradlew needs gradle-wrapper.jar. It’s often excluded by .gitignore (*.jar) or not committed, so fresh clones and CI fail.
Common causes
- gradle-wrapper.jar not committed (ignored by *.jar)
- Corrupted download
- Running gradlew from the wrong directory
⚡ Quick fix
- Regenerate: gradle wrapper (with a local Gradle)
- Commit gradle/wrapper/gradle-wrapper.jar and add a .gitignore exception
Detailed fix by platform
Java
.gitignore:!gradle/wrapper/gradle-wrapper.jar
How to diagnose
- File — Does gradle/wrapper/gradle-wrapper.jar exist?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Android resource linking failed AAPT: error: resource x (aka y) not found — Android resource linking failed
- android:attr/lStar not found AAPT: error: resource android:attr/lStar not found
- Cannot fit requested classes in a single dex file Cannot fit requested classes in a single dex file (# methods: 65536 > 65536) — mergeDex failed
Most viewed in Java
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026