-1

Error:

  PS D:\FlutterProjects\NewLedgersFlutter\ledgers_lite_flutter> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1052], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio
[√] VS Code (version 1.57.1)
[√] Connected device (2 available)

! Doctor found issues in 1 category.
PS D:\FlutterProjects\NewLedgersFlutter\ledgers_lite_flutter> flutter doctor --android-licenses
Error: Could not find or load main class KUMAR
Caused by: java.lang.ClassNotFoundException: KUMAR

Note: I am developing a Flutter project which is giving the above errors when I try to run the application

I have tried with flutter doctor --android-licenses but it's not resolving the issues.

halfer
  • 19,824
  • 17
  • 99
  • 186
Vishali
  • 1,307
  • 4
  • 23
  • 41

2 Answers2

0

Try Following Steps

  1. Android Studio is installed and you can run it, so when it boots up, select configure: Where to find configure on Android Studio screen Refere This Image
  2. In dropdown list open "plugins"
  3. Search for "flutter" and install this plugin together with dart.
  4. Restart the Android Studio and open a new terminal.
  5. You should be able to create a flutter project in Android Studio and "flutter doctor" should work now.
Ravindra S. Patil
  • 11,757
  • 3
  • 13
  • 40
0

It should work if you installed Android Studio;

flutter config --android-studio-dir="YOUR ANDROID STUDIO PATH"

then type flutter doctor to see if it worked

To solve android licence error run;

flutter doctor --android-licenses

then check it with flutter doctor

Muhtar
  • 1,506
  • 1
  • 8
  • 33
  • I have android studio but still it is not working – Vishali Jul 07 '21 at 08:43
  • have you tried this by specifying your directory? – Muhtar Jul 07 '21 at 08:44
  • [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) X Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. ! Doctor found issues in 1 category. – Vishali Jul 07 '21 at 08:46
  • type ; flutter doctor --android-licenses to fix – Muhtar Jul 07 '21 at 08:49
  • i have tried please check my above edited code. i am facing issue after typing flutter doctor --android-licenses – Vishali Jul 07 '21 at 08:50
  • You need Android SDK Command Line Tools installed. If you're using Android Studio go in Preferences -> Appearance & Behaviour -> System Settings -> Android SDK then select the SKL tools tab and install the latest Android SDK Command Line Tools Did it resolve? – Muhtar Jul 07 '21 at 08:54