Flutter Doctor --android-licenses : Exception in thread "main" java.lang.NoClassDefFoundError [duplicate]

Solution 1:

Installing Android SDK Command-line tools from Android SDK Manager did the job for me.

  1. Open Android Studio
  2. Tools > SDK Manager
  3. From the left choose, Appearance & Behavior > System Settings > Android SDK
  4. Select SDK Tools from the top menu
  5. Check Android SDK Command-line tools and click 'apply'.

enter image description here

Solution 2:

Firstly check for your JAVA_HOME path under System Variables it should be like -->

C:\Program Files\Java\jdk-15.0.2
(no semi-colon and no \bin)

and add to path (in System Variables)--> %JAVA_HOME%\bin

if still, you are getting any error try this in Android Studio--> Setting(Appearance & Behavior) -> Android SDK -> check and download Android SDK Command-line tools.

restart terminal and try again with flutter doctor --android-licenses

--> this should do the work.