Android studio is not installed when using flutter doctor - flutter

I am running flutter doctor command. But it is saying android studio is not installed many times. I tried flutter config --android-studio-dir=/home/khamidjon/.android, and many more paths I tried to show but to no luck.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[!] Android Studio
✗ android-studio-dir = /home/khamidjon/.android
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
My question is what location should be shown for PATH in flutter config --android-studio-dir='PATH'?

For Android Studio installed with Flatpak, i found this config to work:
flutter config --android-studio-dir=/path/to/home/.local/share/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
Where path/to/home is the path to your home directory.
(Ubuntu 21.10/Pop!_OS)

Snap packages are installed under /snap/appname/ with subdirectories for each new version. Try this to reslove the issue, it worked for me.
flutter config --android-studio-dir="/snap/android-studio/current/android-studio"
The current directory will make sure that it always points to the latest version.

if you have Androind Studio installed in your home directory /home/khamidjon set up PATH like this: /home/khamidjon/android-studio/bin
to append variable in Linux use command
export PATH=$PATH:/some/new/path
to check your PATH use
echo $PATH

In my case snap packages can retain old versions of the program. So inside /snap/android-studio There were 2 versions of android studio inside directories /snap/android-studio/99 and /snap/android-studio/100. So I showed one of these paths: directory /snap/android-studio/100/android-studio with latest version.
So I ran:
flutter config --android-studio-dir=/snap/android-studio/100/android-studio
flutter doctor
Result:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] IntelliJ IDEA Community Edition (version 2020.3)
[✓] Connected device (2 available)
• No issues found!

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...
flutter doctor
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.

Related

Flutter doctor error -cmdline tools component missing and Android sdkmanager tool not found. Windows

I'm trying to setup an android emulator but I don't have intel. I've been through so many similar pages but none have given me an answer on why I can't get my flutter doctor to work. Here is my flutter doctor results:
C:\Users\icetr>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19044.1645], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.66.2)
[√] Connected device (3 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
C:\Users\icetr>flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to
resolve this.
Here is my android sdk folder:
And my cmdline tools folder:
Inside the lastest folder:
Inside the bin folder:
Here's my paths:
Here's my Android Studio SDK Tools tab:
If anyone needs anymore information just ask.
Install NDK Manager and android command-line tool from android Studio. Also, accept the android licenses.
flutter doctor --android-licenses
After ALOT of trial an error, I had to finally delete all my android packages, Uninstaller Android Studio, and reinstall. Then I deleted all my paths, and reput them in and it fixed it all.

How to build a flutter environment

I'm new to flutter, and I'm trying to build a flutter environment on windows 11, but when I type flutter doctor even though I have android studio, I get an error like the one below. I would appreciate it if someone could tell me what's going on!
PS C:\> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.376], locale ja-JP)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[!] Android Studio
✗ android-studio-dir = C:\Program Files\Android\Android Studio
✗ Unable to find bundled Java version.
[✓] VS Code (version 1.62.3)
[✓] Connected device (2 available)
Brother PLz Apply All these instructions Given in the Link below, Your problem will be solved.
https://stackoverflow.com/questions/52014476/unable-to-locate-the-android-sdk/52018999#52018999

[tag][!] Android Studio (not installed) [tag], Error when run flutter doctor on PC

i have installed latest version of android studio and flutter.
but when i run flutter doctor -v it shows following error [!] Android Studio (not installed)
flutter doctor output:
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[!] Android Studio (not installed)
[√] VS Code (version 1.56.2)
[√] Connected device (2 available)
! Doctor found issues in 1 category.
PS: flutter & dart plugins installed!
If android studio is installed correctly you can run the following command to change the path of android-studio installation:
flutter config --android-studio-dir="ANDROID STUDIO PATH HERE"
after this open a new terminal and run flutter doctor and you should see [√] Android Studio (version x.x.x)
you can install flutter&dart plug,and then restart.
android studio is installed correctly you can run the following command to change the path of the android-studio installation: >flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" // please use your Android Studio Path.

Flutter doctor android-studio-dir problem

When I run flutter doctor, it renders these 2 errors and I can't find a way to get over them:
C:\Users\Work pc>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [version 10.0.19041.928], locale fr-CH)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Cannot execute C:\ProgramData\Oracle\Java\javapath\java.exe to determine the version
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[!] Android Studio
X android-studio-dir = C:\Program
X Android Studio not found at C:\Program
[√] VS Code (version 1.55.2)
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
I mainly have difficulties with solving the second problem, related to android studio.
Thanks a lot!
try running this command on your terminal flutter config --android-studio-dir=[path/to/android-studio]
Try running this command in your cmd
flutter config --android-studio-dir=""
Then restart all your editors for them to load new settings

How to fix Flutter doctor android studio plugin(Dart , Flutter) issue?

I installed the latest version of the Android Studio(4.1.1), the latest version of Flutter (Flutter 1.22.4 • channel stable). I installed the Dart & Flutter plugin in Android Studio. But the flutter doctor gives the plug-in is not installed issue.
Here is flutter doctor command result:
[√] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.16299.19], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
I set the android studio config path
flutter config --android-studio dir="C:\Program Files\Android\Android Studio"
But the result is the same.
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
then if the issue still persists then just shift to the beta channel and the upgrade flutter then it will fix it.
flutter channel stable
flutter upgrade
Run the above commands in terminal.
(Android toolchain) issue: you need to install android studio, if already installed, you need to restart your system and then RUN the following on command prompt
flutter doctor --android-licenses
and you will need to accept all terms and conditions.
(Android Studio) issue: you need to set the following:
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio\"