Unable to locate the android sdk flutter - visual-studio-code

I installed visual_stdio_code and trying to run "flutter doctor" then this is the error.
and when I run flutter doctor on Command Line and this is answer that I have:
flutter devices Unable to locate a development device; please run
'flutter doctor' for information about installing additional
components.
Any help please!

Here's another solution just in case the answer above doesn't work.
Open Android Studio then click on SDK Manager (down-pointing arrow)
This should open a new box with your Android SDK Location at the top. It should look like this:
/Users/your-name/Library/Android/sdk
Copy that path, head to the Terminal and type this:
flutter config --android-sdk /Users/your-name/Library/Android/sdk
Next run:
flutter doctor --android-licenses
You can run flutter doctor to verify
That should help.

Step-1
Config the path of android-sdk:
# use `$ANDROID_HOME` if your android-sdk path is not below
$ flutter config --android-sdk /usr/local/share/android-sdk
Step-2
Add android-license to flutter
$ flutter doctor --android-licenses
Step-3
Check if it works
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.3.3-pre.18, on Mac OS X 10.14.3 18D109, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] Connected device (2 available)
• No issues found!

If you are using Windows your sdk path may be
/Users/yourUserName/Library/Android/sdk
or if are using linux the path maybe
/usr/local/share/android-sdk
Or
/home/yourUserName/Android/sdk
Then Try Executing
flutter config --android-sdk <your-android-sdk-path>

Related

"Unable to locate Android SDK. " while running flutter doctor on windows 10

currently my andoid studio is in location
C:\Android\AndroidStudio
on console
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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
[√] Connected device (2 available)
! Doctor found issues in 1 category.
my sdk location is
C:\Users\aditya jain\AppData\Local\Android\Sdk
1>i have installed Android sdk platform tools and Android sdk tools (obsoloete)
2>I only have a Local, Loacallow and Roaming File but not a Platforms file
, as i have seen many youtube videos ..they said to add to path platform file but i can't see any in my appdata folder in users(it is hidden by default).
https://www.youtube.com/watch?v=7GuGlATHYX8&t=195s
3> ran flutter config command for my sdk and got
C:\Users\aditya jain>flutter config --android-sdk flutter config --android-sdk \C:\Users\aditya jain\AppData\Local\Android\Sdk
Setting "android-sdk" value to "flutter".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>
Android SDK cannot be found by flutter
in this que there is an answer
to run
flutter config --android-sdk /path/to/android/sdk
flutter config --android-studio-dir /path/to/android/studio
but i don't know what i should for my sdk location ..i have less reputation so i can't comment there to ask there so here i am posting ques
also tried
C:\Users\aditya jain>flutter config --android-sdk <sdk-"C:\Users\aditya jain\AppData\Local\Android\Sdk">
The syntax of the command is incorrect.
C:\Users\aditya jain>flutter config --android-sdk <sdk-C:\Users\aditya jain\AppData\Local\Android\Sdk>
The syntax of the command is incorrect.
as is suggested in same que ans but getting this given above
(i know my path contain spaces ..i tried to put my android in downloads so that there will be no spaces but there also i get errors as below
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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
X android-studio-dir = C:\Android\AndroidStudio
X Android Studio not found at C:\Android\AndroidStudio
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>flutter config --android-studio-dir=C:\Users\aditya jain\Downloads\Android\AndroidStudio
Setting "android-studio-dir" value to "C:\Users\aditya".
You may need to restart any open editors for them to read new settings.
C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
X 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
X android-studio-dir = C:\Users\aditya
X Android Studio not found at C:\Users\aditya
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
C:\Users\aditya jain>
i can't rename ' aditya jain' folder to 'adityajain'...it takes space....pls help mee.
please help and thanks community!!
If the path name has spaces, you can wrap the path with double quotes. This allows Windows to identify the path as a single String: "C:\Users\aditya jain\Downloads\Android\AndroidStudio"
If you have already configured SDK path for Flutter (flutter config --android-sdk ) and yet not working than...
Install the platform-tools resolves the problem.
Go to the SDK Manager (top-right in the toolbar), then open SDK Tools, then check-mark ✅ Android-SDK Platform-Tools and apply the changes (As shown below).
For me this solution worked.
Enjoy...
Check image

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.

Everything is install but in Android Studio Flutter and Dart Error

I installed everything but when I run flutter doctor then this error occurs.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
you can ignore those errors if you are going to use vscode as your IDE.
The answer to this error is:
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
when I run these 4 commands then this error will automatically solve.

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