DEV Community

nabbisen
nabbisen

Posted on • Originally published at scqr.net

2

Fix: Flutter doctor が java.lang.NoClassDefFoundError で失敗

問題

Arch Linux にインストールしていた Flutter のバージョンを今日 2.2.0 に更新しました。
その後のことですが、初めて flutter doctor を実行すると "Android license status unknown." と言うエラーが出ました。これは奇妙なことでした。なぜならオプション付きの flutter doctor --android-licenses というコマンドは過去に実施済だったからです。ともかく再実行するしか方法はありませんでした。結果は以下の通りでした:

Console error

上のように "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema" が出ていました。困惑しました。

解決方法

Android Studio の設定画面から、“Android SDK Command-line Tools” をインストールすることで解決できました。

Android Studio を起動します。
メインメニューで [ File ] -> [ Settings ] と進みます。

Android Studio main menus

設定画面で [ Appearance & Behavior ] -> [ System Settings ] -> [ Android SDK ] と進みます。
"SDK tools" をアクティブにします。
"Android SDK Command-line Tools" にチェックを入れて、"OK" を押します。

Android Studio Settings

進みます。

Android Studio Android SDK

command-line tools がインストールされます。

Confirmation

Finish ボタンがアクティブになったら完了です。

謝辞

GithubFlutter イシューに助けられました。(51670 / 56778)。それから ぶるー さんの zenn.dev の記事 に。感謝申し上げます。

結果

flutter doctor --android-licenses が以下のように出力して無事成功しました。

Successful

flutter doctor も 🙂

flutter doctor completed

Top comments (0)

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.