Flutter Doctor --Android-Licenses Gives a Java Error

Flutter Doctor --android-licenses : Exception in thread main java.lang.NoClassDefFoundError

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'.

Sample Image

How to fix flutter doctor --android-licenses java error? Without android studio

The problem is happened because when running flutter doctor --android-licenses, it implicitly running the sdk tools which is only works with JDK 8 (afaik, correct me if I'm wrong).

So, you need to install JDK 8 and set your JAVA_HOME to your JDK 8 installation path.



Related Topics



Leave a reply



Submit