Flutter Doctor: Android Studio Not Installed
The error message “flutter doctor: Android Studio not installed” indicates that Flutter cannot find the Android Studio installation on your system. Flutter relies on Android Studio for several features and tools, including the Android SDK (Software Development Kit) and emulator.
The error message “flutter doctor: Android Studio not installed” typically appears in the command line or terminal when you run the “flutter doctor” command. Here’s an example of how the error might look:
Doctor summary (to see all details, run flutter doctor -v):
[✗] Android toolchain - develop for Android devices
✗ Android Studio not installed; download from https://developer.android.com/studio/index.html
✗ Try re-installing or updating your Android SDK manager manually.
[✓] Chrome - develop for the web (Chromebook only)
[✓] Android Studio (not installed)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
In the example above, the error specifically states that Android Studio is not installed and suggests downloading it from the official Android Studio website. It also suggests re-installing or updating the Android SDK manager manually if necessary.
How to Fix Flutter Doctor: Android Studio Not Installed?
To resolve this issue, you can follow these steps:
1. Install Android Studio:
Download and install Android Studio from this link. Make sure to download the setup file and do the installation on your OS.
2. Configure Android Studio:
After installing Android Studio, open it and follow the setup wizard to configure the necessary components, such as the Android SDK and virtual devices.
3. Set the ANDROID_HOME environment variable:
Once Android Studio is installed, you need to set the ANDROID_HOME environment variable to point to the Android SDK location. Here’s how you can do it:
On Windows:
- Open the Start menu and search for “Environment Variables”.
- Click on Edit the system environment variables.
- In the System Properties window, click the Environment Variables button.
- Under the System Variables section, click the “New” button.
- Set the variable name as “ANDROID_HOME” and the variable value to the path of your Android SDK installation directory (e.g., `C:\Android\Sdk`).
- Click OK to save the changes.
On macOS or Linux:
- Open a terminal.
- Run the following command to open the “.bash_profile” file in your home directory: “nano ~/.bash_profile” (for macOS) or “nano ~/.bashrc” (for Linux).
- Add the following line at the end of the file: “export ANDROID_HOME=/path/to/Android/SDK”
- Replace “/path/to/Android/SDK” with the actual path of your Android SDK installation directory.
- Press “Ctrl+ X” to exit nano, and when prompted, press “Y” to save the changes.
- Restart the terminal for the changes to take effect.
4. Update the system PATH variable:
It’s also essential to include the Android SDK tools and platform-tools directories in your system’s PATH variable. Here’s how you can do it:
On Windows:
- Open the Start menu and search for “Environment Variables”.
- Click on Edit the system environment variables.
- In the System Properties window, click the Environment Variables button.
- Under the System variables section, find the Path variable and click the Edit button.
- Click the New button and add the path to the platform-tools directory within your Android SDK installation (e.g., “C:\Android\Sdk\platform-tools”).
- Click OK to save the changes.
On macOS or Linux:
- Open a terminal.
- Run the following command to open the “.bash_profile” file in your home directory: “nano ~/.bash_profile/” (for macOS) or “nano ~/.bashrc” (for Linux).
- Add the following line at the end of the file: export PATH=”$PATH:/path/to/Android/sdk/platform-tools”
- Replace “/path/to/Android/SDK” with the actual path of your Android SDK installation directory.
- Press Ctrl+X to exit nano, and when prompted, press Y to save the changes.
- Restart the terminal for the changes to take effect.
5. Restart your system:
After completing the steps above, restart your computer to ensure all the environment variables and changes are applied correctly.
6. Verify the installation:
Open a new terminal window and run the “flutter doctor” command again. It should now detect Android Studio and the necessary components correctly.