I’m experiencing an issue with running the flutter doctor command on Mac. When I run the command, it displays the following output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.5 18F132, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[!] Android Studio (not installed)
[✓] Connected device (1 available)
Despite having Android Studio installed and being able to run iOS builds from it, the output of the flutter doctor command states that Android Studio is not installed.
The issue is that Android Studio is not detected by the flutter doctor command even though it is installed. The solution is to add the path to the Android Studio executable to the PATH environment variable.
Here are the steps to do that:
Open the Terminal app on your Mac.
Type the following command to open the bash profile in a text editor: nano ~/.bash_profile
Scroll to the bottom of the file and add the following line: export PATH=$PATH:/Applications/Android\ Studio.app/Contents/MacOS/
Save the file by pressing Control+O and then Control+X to exit the editor.
Close the Terminal app and then reopen it.
Run the flutter doctor command again and it should now detect Android Studio.
Note: If you have installed Android Studio in a different location, make sure to update the path accordingly.