when I start to run flutter doctor it say X Android SDK file not found: adb. how I solve this problem - flutter

C:\Users\ASUS>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
X Android SDK file not found: adb.
[√] Chrome - develop for the web
[√] Android Studio (version 2021.1) ` `
[√] VS Code (version 1.64.2)
[√] Connected device (2 available)
! Doctor found issues in 1 category.

android_sdk/platform-tools/ is not installed in your computer or you made mistake in installing and adding to you path
if your using Android Studio go to settings then System Settings go to Android SDK and install Android SDK Platform-Tools,
if it didnt help reinstall platform-tools, this might be helpful
you can follow link to install it manually SDK Platform Tools
but remember to add the path of android bin folder in your env
for more info you can read this article

Go to SDK Manager from Settings.
Select Android SDK from Left Sidebar.
Select SDK Tools.
Check Android SDK Command-line Tools (latest) and download and
install it.
Run flutter doctor again
Hope solved

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

Android studio is not installed when using flutter doctor

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.

flutter run -bash: Desktop/flutter/bin/flutter: No such file or directory

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.14.6 18G103, locale pl-PL)
[✗] 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/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[!] Android Studio (not installed)
[!] Connected device
! No devices available
I created a my_app folder and typed:
cd my_app
flutter run
The "flutter run" command does not work. How to fix this?
Have you installed android sdk?
If not then installing Android Studio will will install all the required dependencies.
I faced this problem it easy to solve
Open Android Studio
And go to preference
Plugins
Download flutter & dart
You need Android SDK, if you plan on using Android Studio then SDK will be downloaded with the Android Studio
https://developer.android.com/studio is the link to download

Unable to locate a development device; please run 'flutter doctor' for information about installing additional components

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 6.1.7601], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
X Android SDK file not found: C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt.
[√] Android Studio (version 3.2)
[√] Connected devices (1 available)
! Doctor found issues in 1 category.
configure your sdk path
flutter config --android-sdk /path/to/android/sdk
after that accept all the licenses
flutter doctor --android-licenses
finally run
flutter doctor
In Android Studio open
Menu > Tools > SDK Manger
switch to tab "SDK Tools" and check "Android SDK Build-Tools"
click the OK button.
problems are slow
I just go on C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\28.0.3
AND ADD aapt file.
and run command flutter doctor