Fix Flutter doctor failed due to java.lang.NoClassDefFoundError
- Mobile app development
- Published
- 2 min read
- @nabbisen
Table of contents
Trouble Trouble
I updated Flutter (opens in a new tab) version to 2.2.0 on my Arch Linux (opens in a new tab) today.
Then I met the error “Android license status unknown.” in running flutter doctor for the first time. It seemed strange because I had already run it with an option: flutter doctor --android-licenses. Anyway, there was no way except running it again. And the result was:

Thus, I got “java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema”. Puzzled.
Solution Solution
I solved it via Android Studio (opens in a new tab) settings with installation of “Android SDK Command-line Tools”.
Start Android Studio. Go to [ File ] -> [ Settings ] in main menus.

In Settings, go to [ Appearance & Behavior ] -> [ System Settings ] -> [ Android SDK ]. Activate “SDK tools” tab. Check “Android SDK Command-line Tools”. Click “OK”.

Go on.

The command-line tools will be installed.

Finished when Finsh button is activated.
Acknowledgment Acknowledgment
Many thanks to Github (opens in a new tab) Flutter (opens in a new tab) issues (51670 (opens in a new tab) / 56778 (opens in a new tab)) and ぶるー (opens in a new tab)’s zenn.dev post (opens in a new tab).
Result Result
flutter doctor --android-licenses printed the process had been successful.

Then flutter doctor, too 🙂

More on: Build mobile apps
-
Flutter is one of the mobile app frameworks developed by Google which supports both Android and iOS.
-
Devuan GNU+Linux is a fork of Debian without systemd and hence Snaps (Snapd).
Scqr [secureal]
Scqr [secureal]: the engineering practice of Reflerd Inc. (opens in a new tab)
Comments and feedback are welcome.