PS C:\Myfolders\proj\flutter-proj\flutterapplicationtemp> flutter doctor…
- User
PS C:\My_folders\proj\flutter-proj\flutter_application_temp> flutter doctor --android-licenses Flutter assets will be downloaded from https://mirrors.cloud.tencent.com/flutter. Make sure you trust this source! Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.sdkmanager.SdkManagerCli Android sdkmanager tool was found, but failed to run (C:\Users\Reza\AppData\Local\Android\sdk\cmdline-tools\latest\bin\sdkmanager.bat): "exited code 1".
Try re-installing or updating your Android SDK, visit https://flutter.dev/to/windows-android-setup for detailed instructions. PS C:\My_folders\proj\flutter-proj\flutter_application_temp> flutter config --jdk-dir="C:\Program Files\Android\Android Studio\jbr"Setting "jdk-dir" value to "C:\Program Files\Android\Android Studio\jbr".
You may need to restart any open editors for them to read new settings. PS C:\My_folders\proj\flutter-proj\flutter_application_temp> flutter doctor -v
Flutter assets will be downloaded from https://mirrors.cloud.tencent.com/flutter. Make sure you trust this source! [√] Flutter (Channel stable, 3.29.3, on Microsoft Windows [Version 10.0.26100.3775], locale en-US) [593ms] • Flutter version 3.29.3 on channel stable at C:\My_folders\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ea121f8859 (4 weeks ago), 2025-04-11 19:10:07 +0000 • Engine revision cf56914b32 • Dart version 3.7.2 • DevTools version 2.42.3 • Pub download mirror https://mirrors.cloud.tencent.com/dart-pub • Flutter download mirror https://mirrors.cloud.tencent.com/flutter[√] Windows Version (11 Pro 64-bit, 24H2, 2009) [2.5s]
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [1,027ms] • Android SDK at C:\Users\Reza\AppData\Local\Android\sdk • Platform android-35, build-tools 35.0.1 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java This JDK is specified in your Flutter configuration. To change the current JDK, run:
flutter config --jdk-dir="path/to/jdk". • Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42) X Android license status unknown. Runflutter doctor --android-licensesto accept the SDK licenses. See https://flutter.dev/to/windows-android-setup for more details.[√] Chrome - develop for the web [139ms] • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.6) [137ms] • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.13.35931.197 • Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2024.3) [37ms] • Android Studio at C:\Program Files\Android\Android Studio • 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 21.0.6+-13355223-b631.42)
[√] VS Code (version 1.99.3) [35ms] • VS Code at C:\Users\Reza\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.110.0
[√] Connected device (3 available) [374ms] • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.3775] • Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.93 • Edge (web) • edge • web-javascript • Microsoft Edge 136.0.3240.50
[√] Network resources [3.4s] • All expected network resources are available.
! Doctor found issues in 1 category. PS C:\My_folders\proj\flutter-proj\flutter_application_temp>
- Assistant
You're encountering this error:
Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.sdkmanager.SdkManagerCli Android sdkmanager tool was found, but failed to run (C:\Users\Reza\AppData\Local\Android\sdk\cmdline-tools\latest\bin\sdkmanager.bat): "exited code 1".This occurs when the Android SDK cmdline-tools are corrupt or incorrectly structured — especially the
sdkmanager.batcan't find necessary Java classes.Let's fix it step-by-step:
✅ 1. Check the Folder Structure
Your path refers to:
C:\Users\Reza\AppData\Local\Android\sdk\cmdline-tools\latest\Ensure the folder structure is like this:
cmdline-tools/ └── latest/ ├── bin/ ├── lib/ └── source.propertiesVery often, people accidentally download and extract into:
cmdline-tools/cmdline-tools/latest/which causes this exact issue.
✅ If your
latestfolder directly contains thebin,lib, andsource.properties, you're good. ❌ Ifcmdline-tools/latest/cmdline-tools/bin, fix it!
✅ 2. Fix Folder Structure if Needed
If you have:
C:\Users\Reza\AppData\Local\Android\sdk\cmdline-tools\latest\cmdline-tools\binthen do this:
- Rename/remove the incorrect
latestfolder. - Download
cmdline-toolsagain:- Go to: https://developer.android.com/studio#command-tools
- Download: Command line tools only (Windows).
- Unzip it to:
It should look like:C:\Users\Reza\AppData\Local\Android\sdk\cmdline-tools\latest\latest/ ├── bin/ ├── lib/ └── source.properties
✅ 3. Verify Java Path
You're using Android Studio's JDK:
C:\Program Files\Android\Android Studio\jbrThat is fine. Just make sure
JAVA_HOMEis either:- Pointing to this JDK, or
- Not set (Flutter will use your configured JDK).
✅ 4. Accept SDK Licenses Again
Once the correct tools are in place:
flutter doctor --android-licensesFollow prompts to accept all licenses.
✅ 5. Recheck Status
flutter doctor -vYou should now see:
[✓] Android toolchain - develop for Android devices ...
✅ Optional: Set SDK_PATH Manually
If Flutter somehow can't detect the correct SDK path, set it manually:
flutter config --android-sdk C:\Users\Reza\AppData\Local\Android\sdk
Summary
Step Action ✅ 1 Check/fix folder structure of cmdline-tools✅ 2 Redownload cmdline-toolsif needed✅ 3 Java path is OK (JBR from Android Studio) ✅ 4 Run flutter doctor --android-licensesafter fix✅ 5 Use flutter config --android-sdk <path>if neededLet me know if you'd like a download link or I can walk you through verifying the folder.
- Rename/remove the incorrect
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.