Flutter doctor --android-licenses not finding sdkmanager without Android Studio - flutter

I'm trying to get my very first Flutter application up and running. When I ran flutter doctor it was saying that I was missing Android SDK, so I installed sdkmanager and ran:
sdkmanager "platform-tools" "platform;android-29" "build-tools;28.0.3"
From there I ran flutter config --android-sdk /opt/android-sdk
I got an error saying that I'm missing cmdline-tools, however I don't have Android Studio and don't want to as well. So I went on Android Studio's website and downloaded a manual cmdline-tools and moved the file to android-sdk. OK so far so good, right? No, now I needed to run flutter doctor --android-licenses and it's saying Android sdkmanager not found. Why? Is there something I'm missing? I'm doing all of this in Ubuntu.
Below is the image of flutter doctor status
Shows me running flutter doctor --android-licenses
As well as shows the path to the android-sdk in the terminal
I have as well set flutter config --android-sdk to the correct path
and is the reason why flutter doctor has no issues with finding the
android-sdk
Image!!

Android toolchain - develop for Android devices X cmdline-tools component is missing run path/to/sdkmanager --install "cmdline-tools;latest"
This error means your "Android SDK Command-line Tools are missing"
Open Android Studio
In the Menu bar , click Tools(4th last)
choose SDK Tools panel
Tick Android SDK Command-line Tools
Click Apply at bottom of the window

I gave up and just downloaded android studio using snap package manager and within android studio I did the steps discussed above.
After downloading cmdline-tools from android studio. I have just set the android config --android-sudio-dir "toMyAndroidStudioPath" example. /home/myName/Android/Sdk....

Related

Flutter Doctor - Android toolchain (Missing)

I ran a fresh installation of the latest version of Flutter and then ran flutter doctor. Everything is fine but I always get this error (this is why I am reinstalling flutter):-
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
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.
I have tried several fix like going to this website -> https://www.programsbuzz.com/article/set-android-environment-variable-path-windows-10 but nothing works. PLease help me.
You can either run flutter doctor --android-licenses and it will install the command line tools or if it is giving an error regarding the path of sdkmanager then you can install Android Studio and install command line tools directly from there.
Go to SDK Manager > Android SDK > Check on Android SDK Command-Line Tools
Then click on apply and it will install all the required dependencies.
Run flutter doctor to check if everything is installed successfully or not.
Go to your Terminal and Simply Run :
flutter doctor --android-licenses
It will solve this issue .

vs code cannot launch android emulator

i was just starting with flutter and i was using android studio before and i have an emulator but now i wanted to start with flutter and tried to run the default flutter project but says no device and when i try to connect to the emulator i have it just keeps loading and says "Failed to launch Pixel 3a API 29: Error: Emulator didn't connect within 60 seconds"
tried a lot to fix it but still the same error.
and by the way when i run flutter doctorit displays
Doctor summary (to see all details, run flutter doctor -v):
1.[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
2.[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
3.[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
4.[✓] Android Studio (version 3.5)
5.[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
thanks in advance.
I have faced this problem before, Try these steps:
Open your android studio, go to avd manager
Now select your emulator, click on dropdown in actions and wipe data
Check whether you have intel x86 emulator accelerator ticked in sdk tools in android studio.
If the problem still persists, you can remove this emulator and install a new one.

android-studio android-studio-dir location

I am trying to get flutter/android studios to work on linux and i am having an issue getting flutter to recognize my android-studio location.
I am able to run android-stuio, but when i try to tell flutter my install location via the android-studio-dir param i get something that doesn't work.
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.27.0-2.0.pre.78, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio
✗ android-studio-dir = ~/Downloads/android-studio/bin/
✗ Android Studio not found at ~/Downloads/android-studio/bin/
[✓] VS Code (version 1.53.1)
[!] Connected device
! No devices available
At location ~/Downloads/android-studio/bin/ i have the bin directory of my android studio install. This obviously doesn't work.
I have tried to look up what directory android-studio-dir needs to point at and it seems that i wants to point at a directory like /path/to/android/studio.
but in my install directory i dont have a studio directory to point at?
So my question is what should android-studio-dir point at?
I am able to run android studio by ./~/Downloads/android-studio/bin/studio.sh
So i am fairly confident i have android studio "installed" correctly.
For windows the commands are same like those from #Doc but take care of the slashes:
flutter config --android-sdk="C:/TestFolder/AndroidSDK"
flutter config --android-studio-dir="C:/Program Files/Android/Android Studio"
the commands are
flutter config --android-sdk="/home/user/Android/Sdk"
flutter config --android-studio-dir="/usr/local/android-studio"
Don't use the bin folder, just mark the root folder for both the sdk and the IDE. Also, use complete path.
A. To resolve your unrecognized sdk. issue, use following steps
Find your dir. location. You will find at same place
C:\users\UserName\AppData\Local\Android\SDK
Mine was at
C:\Users\SHARM\AppData\Local\Android\Sdk
Go to PowerShell and type
flutter config --android-sdk
"C:\users\UserName\AppData\Local\Android\SDK"
Change your Username above
PowerShell screenshot showing how I resolved unable to locate SDK issue
B. To resolve dir issue, type
flutter config --android-studio-dir "type directory name"
In my case, it was
flutter config --android-studio-dir "C:/Program Files/Android/Android Studio"
C. I have license issue so I am sharing here if in case you encounter it after fixing SDK and dir issue.
C.1 Open you Android Studio
C.2 On main screen, Click Advanced > SDK Manager
SDK Manager
C.3 Select SDK Tools
Check Android SDK Command-line tools and click ‘apply’.
Check Android SDK Command-line tools and click ‘apply’
C.4 Click Apply.
C.5 Your license issue will be resolved. You can test it by again going to PowerShell and type
flutter doctor
You will pass all tests like I did in photoflutter passed all tests
If you want to check your configurations for SDK, dir etc, just type flutter config and it will show you all configurations.

Android Studio Dart And Flutter Plugin is not installed

Here is the flutter doctor result:
[√] Flutter (Channel stable, 1.22.1, on Microsoft Windows [Version 10.0.18362.30], locale en-US)
[√] 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.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
I have already installed the flutter plugin. But the problem still exists. How can I fix this?
Just run this on your terminal (Mac users)
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Well hello all
I would suggest you all to follow the steps what flutter documentation sites tells you to do
For windows-->There are some people who got detected flutter and dart plugins by the flutter doctor and few are not
I got this issue when I tried to install ...
I did everything like installed flutter and dart plugin still my flutter doctor haven't detected the plugins ...
following steps worked for me
flutter channel dev
flutter upgrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
flutter doctor -v
note :--- flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" should be example flutter config "C:\Program Files\Android\Android Studio"
above steps worked for me i hope it will helps you too :)
change channel master to dev.
then upgrade.
flutter channel dev
flutter channel upgrade
try again
flutter doctor
Note: I think it's Android Studio 4.1 issue...
Since you say you have flutter plugin installed in Android Studio, and if Android Studio correctly shows your installed plugin, there is no reason to believe any third-party tool reporting otherwise.
Also, this will not affect your flutter development and your IDE plugins will work as expected inside the IDE and flutter tool's commands work independent of the IDE in use.
Android Studio 4.1 apparently changed its default plugin install path.
Related github issue: [flutter_tools] IDE plugin validators should be deprecated #61246
Flutter does not directly use the IDE plugins, so doctor failing to detect them does not affect any behavior (it's just annoying).
open terminal:
run> flutter channel dev
run> flutter channel updrade
open terminal:
Mac User:
flutter config --android-studio-dir=/Applications/Android\ Studio.app
Reinstall Flutter Plugin from Android Studio
Are you using Android Studio V 4.1?
With Android Studio V4.1 there is a problem.
Try to reinstall Android Studio but Version 4.0.1 and try it again, chances are this will fix your problem.
Open Android studio
Follow the Path Configure > Plugins > marketplace > search Flutter & Dart > Install
Restart IDE(Android studio)
Open Terminal and Export Flutter Path
and run flutter doctor -v
If you are upgrading for an existing project:
Run
git clone https://github.com/flutter/flutter.git
in your terminal.
The be sure to delete the Flutter folder in your App's root directory. Otherwise you will get over 50k errors popping up
Check your flutter PATH
which flutter
if you get /path-to-flutter-sdk/bin//flutter or similar you may have added an extra / in your $HOME/.rc_file. Remove the last '/', restart terminal and try again
this worked for me
flutter channel dev
flutter doctor

Android sdk manager not found

How can I fix this error ?
$ flutter doctor --android-licenses
Android sdkmanager tool not found (E:\Android Studio\android-sdk-windows-1.6_r1\tools\bin\sdkmanager).
Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.
Try configuring android studio path using the command flutter config --android-studio-dir <Your Path To Android Studio>.
Here's how I solved the problem on a brand new install of Android Studio :
In Android Studio, open SDK Manager
Go to the SDK Tools tab
Uncheck Hide obsolete packages. That will display more tools in the list.
Check Android SDK Tools (Obsolete) in the list
Click Apply or OK