Coding⏱️ 2 min read📅 2026-05-31

How to Fix: flutter doctor --android-licenses gives a java error

Flutter Doctor error on Android licenses with Java NoClassDefFoundError

Quick Answer: Update the Flutter SDK to a newer version or use the --force option to resolve the issue.

The error you're encountering, "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema", is a common issue in Android development. It occurs when the Java compiler cannot find the XmlSchema annotation.

⚠️ Common Causes

  • Outdated Android SDK version
  • Lack of Java Development Kit (JDK) or Android SDK tools

🛠️ Step-by-Step Verified Fixes

Method 1: Update Android SDK Version

  1. Step 1: Open the Android Studio and navigate to File >Settings (or Preferences on Mac).

Method 2: Install Java Development Kit (JDK) and Android SDK tools

  1. Step 1: Download the latest JDK from the official Oracle website.
  2. Step 2: Download the Android SDK tools from the official Android Developer website.

💡 Conclusion

By following these steps, you should be able to resolve the "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema" error and get your Flutter project up and running smoothly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions