In Windows
If your Android Studio install by default, you can use this command:
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
After this command, flutter can found android studio, but the plugin can’t…
Run the following command in your terminal:
flutter doctor
You will see something like below:
Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.18363.1016], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [!] Android Studio X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [√] VS Code (version 1.48.0) [!] Connected device ! No devices available ! Doctor found issues in 2 categories.
In Linux (Ubuntu)
Note: for those who are facing the problem in Ubuntu and Android Studio is installed with snap:
flutter config --android-studio-dir="/snap/android-studio/current/android-studio"
Note: for those who are facing the problem in Ubuntu and Android Studio is installed with JetBrains Toolbox:
flutter config --android-studio-dir=/home/myuser/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882
Where ./201.7042822 matches the current version of Android Studio installed. You’ll have to check which one you have and update it in the command above.
A similar issue I faced and solved:
I had a similar issue which I solved by updating my flutter config as follows:
flutter config --android-sdk="$HOME/Android/Sdk" flutter config --android-studio-dir="/usr/local/android-studio"
This was on Ubuntu 20.04.1.
Assumptions:
- You have extracted the downloaded android studio zip to /usr/local/android-studio
- If you install Android studio using snap then
flutter config --android-studio-dir="/snap/android-studio/current/android-studio"