DEV Community

nabbisen
nabbisen

Posted on • Edited on • Originally published at scqr.net

3 1

Fix Flutter doctor failed due to java.lang.NoClassDefFoundError

Trouble

I updated Flutter version to 2.2.0 on my Arch Linux 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:

Console error

Thus, I got "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema". Puzzled.

Solution

I solved it via Android Studio settings with installation of “Android SDK Command-line Tools”

Start Android Studio.
Go to [ File ] -> [ Settings ] in main menus.

Android Studio main menus

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

Android Studio Settings

Go on.

Android Studio Android SDK

The command-line tools will be installed.

Confirmation

Finished when Finsh button is activated.

Acknowledgment

Many thanks to Github Flutter issues (51670 / 56778) and ぶるー's zenn.dev post.

Result

flutter doctor --android-licenses printed the process had been successful.

Successful

Then flutter doctor, too 🙂

flutter doctor completed

Top comments (2)

Collapse
 
pablonax profile image
Pablo Discobar

If you are interested in this topic, you can also look at my article about free vs paid Flutter templates. I'm sure you'll find something useful there, too.  - dev.to/pablonax/free-vs-paid-flutt...

Collapse
 
nabbisen profile image
nabbisen

@pablonax
Hi, thank you for your kindness, giving me useful information😄
I found it very interesting!!!

Great read:

Is it Time to go Back to the Monolith?

History repeats itself. Everything old is new again and I’ve been around long enough to see ideas discarded, rediscovered and return triumphantly to overtake the fad. In recent years SQL has made a tremendous comeback from the dead. We love relational databases all over again. I think the Monolith will have its space odyssey moment again. Microservices and serverless are trends pushed by the cloud vendors, designed to sell us more cloud computing resources.

Microservices make very little sense financially for most use cases. Yes, they can ramp down. But when they scale up, they pay the costs in dividends. The increased observability costs alone line the pockets of the “big cloud” vendors.