Flutter doctor shows the message "cmdline-tools component is missing" - flutter

when i run flutter doctor shows this
message
I installed flutter and android studio in d drive. Downloaded all tools that needed.
android studio sdk tool
android studio sdk
Also added the variable in both system and user.
user
user
system
system
I cannot understand why flutter doctor show that error.Can anyone help me?

Before you do this, make sure you have internet connection to install the command line tools.
Open android studio sdk manager
At the SDK managers tabs, selects SDK Tools
From the list of tools shown, you'll see Android SDK Command-line tools.Select it and click on apply and ok.
Command-line tools will be installed and you are good to go.

Related

Avdmanager not found

I am trying to run my first flutter app emulator, which is having complications at various level, I have tried too much but could not make through it, here is what I have tried.
On trying to click on Create Android Emulator in Visual studio code, the dart extension shows following:-
link to img
I don't know why it is happening as on checking, it is present:-
link to img.
I would like to point out here that I am not able to understand what I have to put in flutter --android-sdk {path}.
Also on running flutter doctor, it shows the absence of visual studio despite the fact that I have it in place(that is why I could take the first screenshot). One thing I would like to point out here is that my vscode is in C drive while my flutter-test folder(which contains everything related to flutter) is in D drive:
link to img
Please help so that I can further follow along to create an android app. Also ask if any further information is needed.
You need to know that having Android Studio Installed will solve the majority of issues caused.
STEPS:
Clean out all your Flutter, Dart and Android installation
Download Android Studio from official website (the latest version is Android Studio Electric Eel)
After the installation of Android Studio, open it and add the flutter and dart plugins
Now download flutter and follow the installation steps.
After adding flutter, go to Edit the system environment on your PC and add JAVA_HOME variable with C:\Program Files\Android\Android Studio\jbr. Noticed I used jbr not jre because with Android Studio Electric Eel jbr replaced jre.
Afterward, open new terminal and run flutter doctor --android-licenses
WHAT DID WE DO ABOVE?
We cleaned our installation and downloaded the latest Flutter version which has Dart downloaded automatically. Next, we Installed Android Studio Electric Eel which has Java and Android settings in-build. This way we solve 99% of the problems here: The last thing is to create an Emulator using Android Studio not VSC.
For future help, please comment below. Bye

setup nox (or genymotion )as android emulator for vscode flutter

for some reason, I don't want to install android studio(one of them is I don't have enough space for now) but instead, I want to work with vscode and nox(or genymotion). and my question is: Is it possible to connect vscode and an (android and ios) emulator to see the result? in other words, I want to connect the nox as an emulator to vscode and see the result inside of it.
Android studio take too much space and even my computer also become hot when open Android studio. But what I did I installed Android studio and Android emulator but I don't use Android studio rather I use VScode.
So as far as I know you need Android studio to install emulator then you can use VScode with it.
Finally, I found out how I can connect Genymotion to the VS Code(without Installing Android Studio).in total SDK manager wasn't installed on my laptop, so at first, I installed it. and then
Platform Tools (ADB & Fastboot)
Install Platform
Add System Image
Install Build Tools
but wait I just name the steps I've done. you can follow this article on this link to get more details.
and finally, instead of installing an emulator, I used Genymotion with Flutter in VS Code, which you can follow in this article to get more information. Click here

Why visual studio code does not recognize my phone?

I am new with flutter. when connecting the device the pc detects it but not the vscode
However, here I leave what flutter doctor throws. I'm new to flutter so I don't quite understand what they suggest. I already have usb debugging enabled developer options install via usb etc. it's a redmi 9a.
Simple way:
Download android studio
Click Tools > SDK Manager. Or
In the SDK Tools tab,
In the SDK platforms tab, install any one android version
Go to the windows terminal and accept android licenses.
flutter doctor --android-licenses
Make sure you have vs code extensions for flutter installed and then restart your VS Code.
You also have to enable USB debugging in developer options in your mobile in order to get detected by your PC
There is a hard way too without installing android studio.

Grandlew bat file not found in windows 10

I have installed flutter and android studio. Followed some resources I have added path.(In windows)
But everytime I run the first project it is giving errors
like. Grandlew bat file not found.
sometimes : exception: exit with 1
Flutter doctor is always giving licenses unknown. I tried number of solutions in the YouTube and from here..but still getting same thing..
My dreams are going to stop in the first step.
you need to install flutter and dart plugin in your android studio/VS code.
to install a plugin in Android Studio follow these steps
Launch Android Studio application
Choose File -> Settings (For Mac Preference )
Search for Flutter then for dart(But dart will be installed automatically with flutter)
I just noticed you don't have Android SDK either, for that, you should go to your android studio and on the top right corner click on the SDK icon, and then install 28/29 version of android SDK hopefully it will solve your problem
alternatively, you can download SDK from here as well

unable to run flutter app in vs code with real device

i am trying to run flutter app in visual studio code by pressing F5,
connecting a real device, but unable to run the app
my android sdk path--
C:\src\flutter\flutter
my flutter app path--
D:\flutter\flut\flut
error message--
flutter doctor -v ----
Try the followings.
run the flutter doctor --android-licenses and accept licenses.
(it happened to me too)
Install the flutter & DART plugin in Android Studio.
Then run the project again
Add the flutter bin dir to your path
First you have to accept the licenses for Android SDK. Write the following commands in your terminal.
flutter doctor --android-licenses
After adding above command you have to accept all the list of licenses one by one to get ahead.
In your case, you have not installed dart and flutter plugin. So, close your project and go to "Welcome Screen" of IDE where you will see a "Configure" button. click on it and select "Plugins".
Now, search for Flutter and Dart and install both of them. After installing both restart your IDE to apply new changes.
Now, you're Done with the setup. Now, you can run your project in real device or emulator by configuring them.
you need to accept the android licence, to do so,
run the command
flutter doctor --android-licenses
in your terminal, and press yes when prompted in the terminal.
The flutter and dart plugins are also not installed on your Android Studio, to include these, add dart and flutter plugins and restart your Android Studio.
And finally run the command flutter doctor in your terminal and check every thing is installed correctly.
Had that issue. Had to downgrade Java from 11 to 8. After that I have been able to accept the all the licenses. But in order to run the app - had to upgrade back Java 11. And also has to be sure that that JAVA_HOME path is JDK, but not JRE. But that that is the next thing.