-
Notifications
You must be signed in to change notification settings - Fork 0
Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Snoy-Kuo edited this page Mar 21, 2022
·
1 revision
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain.
The project's output apk can be generated locally by command ./gradlew assembleRelease. When it goes to Jenkins, the gralew task ran to fail with 'Could not find or load main class org.gradle.wrapper.GradleWrapperMain.' error message.
- macOS 11.6 (Big Sur) x64
- Android Studio Bumblebee Patch 1
- Android SDK version 27
- buildTool: 28.0.3
- Android Gradle Plugin: 3.3.3
- Gradle: 4.10.3
- Gradle JDK: corretto-1.8
- Kotlin: 1.3.72
- Jenkins: 2.190.2
-
Gradle编译错误处理 “Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain”
- remove
*.jarfrom .gitignore file
=> I don't have this line in .gitignore.
- remove
-
Could not find or load main class org.gradle.wrapper.GradleWrapperMain
- git add -f gradle/wrapper/gradle-wrapper.jar
=> Not work for me. I don't have .jar ignorance in .gitignore. - If gradle-wrapper.jar not in project, run
gradle wrappertask to generate the file.
=> Not work for me. The gradle-wrapper.jar file just there in the ProjectRoot/gradle/wrapper folder.
- git add -f gradle/wrapper/gradle-wrapper.jar
- Be sure these four files pushed to remote repo:
gradle-wrapper.jar,gradle-wrapper.properties,gradlew,gradlew.bat- Check remote repo, if they are not there, check .gitignore file again. In my case, I have ignored
/gradle/,gradlew, andgradlew.bat - It works.
- Check remote repo, if they are not there, check .gitignore file again. In my case, I have ignored
- Be sure these four files pushed to remote repo:
gradle-wrapper.jar,gradle-wrapper.properties,gradlew,gradlew.bat- Check remote repo, if they are not there, check .gitignore file again. In my case, I have ignored
/gradle/,gradlew, andgradlew.bat
- Check remote repo, if they are not there, check .gitignore file again. In my case, I have ignored