Flutter Install Issue On Windows 10: Fixing Exception in thread “main” java.lang.NoClassDefFoundError: …

After installing Flutter and Android Studio on Windows, you run the following command:

flutter doctor

A common problem you might encounter after installing Android Studio is that Android Studio is not found. This is fixed by setting the Android Studio Directory with this command (assuming the default install path):

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

Afterward, you might be asked to accept the Android license.

You can do so with this command:

flutter doctor --android-licenses

What you will now encounter after running the license acceptance would be the exception error.

To fix this, launch Android Studio, select Projects and the More Actions. Pick SDK Manager from the drop down list.

Choose the SDK Tools tab and check the “Android SDK Command-line Tools (latest)”. Click OK.

Run flutter doctor command again and now everything should be good.

Enjoy Flutter!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.