起こったこと
開発 PC が変わったので AndroidStudio で Flutter の環境を作ろうと思い、インストール、プロジェクト作成と進めたのですが次のエラーが出てプロジェクトの作成に失敗してしまいました。
Could not find an option named "androidx". Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.
意外と情報が少なく無駄に時間を要したので、メモしておきます。
なお、インストール作業は自分の 過去記事 を参考にしながら進めていました。
解決方法
どうやら Flutter の SDK バージョンが複数インストールされている場合などに起こるようで(いつ入れたか記憶にない……)、次のコマンドを打てばエラーが解消します。
$ flutter channel stable
$ flutter upgrade
参考にしたサイト
When I create a new project, I will report the following error #42812 | GitHub