Fix Flutter doctor failed due to java.lang.NoClassDefFoundError

Flutter on Arch Linux (5 Part Series)

1 Flutter 2 on Arch Linux: Getting started
2 Fix missing Flutter menus in Android Studio
3 Fix Flutter doctor failed due to permission denied on Linux
4 Fix Flutter doctor failed due to java.lang.NoClassDefFoundError
5 Flutter 3 on Arch Linux: Getting started

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:

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.

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

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

Result

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

Then flutter doctor, too

Flutter on Arch Linux (5 Part Series)

1 Flutter 2 on Arch Linux: Getting started
2 Fix missing Flutter menus in Android Studio
3 Fix Flutter doctor failed due to permission denied on Linux
4 Fix Flutter doctor failed due to java.lang.NoClassDefFoundError
5 Flutter 3 on Arch Linux: Getting started

原文链接:Fix Flutter doctor failed due to java.lang.NoClassDefFoundError

© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容