Skip to content

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain - Help! #116027

@mprogers

Description

@mprogers

I searched stackoverflow.com, etc., with no luck. The only thing that I know about Android development is that if I see the word "Gradle", it's not going to be a good morning. Any help would be appreciated.

Note that I can create a new project and it runs fine.

Steps to Reproduce

  1. I downloaded a student's flutter project
  2. I cleaned the project
  3. I attempted to run it and got this error:

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
Exception: Gradle task assembleDebug failed with exit code 1

Logs

Logs
flutter run
Multiple devices found:
...
[1]: sdk gphone64 arm64 (emulator-5554)
[2]: sdk gphone64 arm64 (emulator-5556)
[3]: iPhone 14 Pro Max 
[4]: macOS (macos)
[5]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1
Using hardware rendering with device sdk gphone64 arm64. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Building with Flutter multidex support enabled.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
Running Gradle task 'assembleDebug'...                             699ms
Exception: Gradle task assembleDebug failed with exit code 1
[✓] Flutter (Channel stable, 3.3.9, on macOS 13.0.1 22A400 darwin-arm, locale en-US)
    • Flutter version 3.3.9 on channel stable at /Applications/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (3 days ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/mprogers/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.73.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.52.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • sdk gphone64 arm64 (mobile) • emulator-5556                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPhone 14 Pro Max (mobile)  • FB304F21-DA39-47D4-9B60-B99D485C8B86 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-1 (simulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 107.0.5304.121

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions