I'd like to use vscode as my main editor for flutter development. I successfully setup the commandline tools (v6200805) and created a virtual device using avdmanager. I was also able to launch the device using the flutter emulators -launch command. However on using flutter doctor command, flutter does not recognize the sdk path. The latest version of the commandline tools follows a different file structure as compared to the previous version.
Also, I configured flutter to know the dir of Android sdk path using
flutter config — -android-sdk E:\IDEs\Android\cmdline-tools\ but to no luck.
How do i work around this problem?
Error shown by flutter doctor
Related
I am not getting here it says the current flutter SDK version is 2.0.2 but when I go on a terminal and search flutter --version it says Flutter 2.8.1 see below picture
See this pic why is it? in the above pic it says the flutter SDK version is 2.0.2 and in the below pic it says 2.8.1 ,Pls guide why this difference
You are very likely to have two different versions of Flutter installed on your computer. This is possible because your IDE has its own setting to know where it should look for Flutter SDK which is what is used in your first screenshot.
In your second screenshot, you are running the flutter command in a terminal. To resolve what flutter means, it uses your PATH environment variable to search for an executable matching your command name.
So my guess is that your IDE and PATH environment variable points to two different Flutter installations on your computer.
I installed flutter and it was working fine but after updating it to recent version, flutter is not able to find the android sdk manager. I've tried running flutter doctor and tried to install android licenses but the error "Android Sdkmanager not found is shown". I've attached the image of my command prompt here.
Here's what I've already tried but didn't worked...
I had cmd tools installed in my android studio, so I uninstalled and reinstalled it.
Changed path settings, added my sdk path to environment variables.
Also added cmd tool path to system variables.
Deleting the cmd tools and downloading it from android studio official site and pasting it into the sdk manager folder.
Changing the sdk path to the sdk manager folder path in command prompt.
Running command prompt as administrator.
I've attached the image of command prompt with 'flutter doctor -v' here
I've tried almost everything I found on google but nothing seems to solve my problem. I don't know what should I do next and I'm stuck in it from two days.
Here's the flutter doctor --android-licenses -v image
Please help, Thanks.
First, make sure to follow the official documentation step by step to install and set up Android SDK for Windows (Maybe uninstall first everything from before to remove any kind of conflict that exist). Also, don't install the Command line tools only and include it to PATH (Remove every related Android SDK PATH or even other environment variables that are still there too). The recommended way is inside the Android Studio in Preferences -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools and select Android SDK Command-line Tools.
Second, make sure you restart the command prompt for the changes to take effect. For example, changing PATH doesn't update the running processes. So, just restart the ones that need the new configurations. Sometimes even restart the entire system so every process has the updated configurations.
And then try again to accept the licenses:
flutter doctor --android-licenses
I found the solution to my problem stated above, the android sdkmanager.bat file was getting deleted automatically by an antivirus named "SAntivirus". I uninstalled the file from my program files and it worked. Now my flutter doctor is working fine and accepted all the licenses. Thank you all for your support.
you should install the android sdk command line tools in sdk tools on your android studio ( uncheck the hid obselute pacakges ).
I'm trying to use flutter on Android Studio. I have the flutter plugin installed on Android Studio and when i try to create a new flutter project it behaves normally, in the sense of it lets me write the project name, the flutter sdk path and so on. But when i click on finish absolutely nothing happens. I just see the Android Studio Welcome page where i can create new Projects. So i figured I'd see what flutter doctor -v has to say about it and it gives me these errors:
So i try to find a solution by typing : flutter doctor --android-licenses but i get another error:
And yes i have set the PATH variable and i have installed Android SDK Tools.
I tried everything but nothing seems to do the job.
Any help would be appreciated.
if you are using windows OS, backup your data, reinstall windows..remember to choose option to keep your files and application..after finish..check updates and update windows..
then run flutter doctor --android-licenses
I was just wondering if I can use flutter without downloading Android studio because Android Studio is very heavy
You can do so, by following the below steps.
Note: The sum of all the downloaded files is about 1.5GB including VS Code.
Download and install VS Code 88MB.
Install the Flutter extension, which automatically installs the Dart extension.
Download the Flutter SDK 818MB. Extract to C:\Flutter.
Download the Android Command Line Tools 115MB. Extract to C:\Android\cmdline-tools.
Download the Android Platform Tools 5MB. Extract to C:\Android\platform-tools.
Download the Java SDK (version 17 or lower) 171MB. Extract to C:\Java.
In Environment Variables edit the Path system variable and add the following:
%SYSTEMDRIVE%\Android\platform-tools +
%SYSTEMDRIVE%\Android\cmdline-tools\bin +
%SYSTEMDRIVE%\Flutter\bin +
%SYSTEMDRIVE%\Java\bin.
In Environment Variables add the following new system variables.
Name: JAVA_HOME. Value: C:\Java.
Name: ANDROID_HOME. Value: C:\Android\cmdline-tools.
Name: ANDROID_SDK_ROOT. Value: C:\Android\cmdline-tools.
Run the following command as administrator: sdkmanager --licenses, and accept all the licenses.
In phone's settings, enable Developer options and USB debugging, also enable the Developer mode on your PC.
Connect your phone and make sure that all drivers are installed.
Create a new flutter project and run it using the command flutter run. This will download the needed files (automatically) to run the app on your phone and create an APK file. Download size is about 300MB.
You can use Visual Studio Code or Emacs Link
You can still code, but it won't compile, since Flutter SDK needs the Gradle and other tools(that comes with android studio) to be compiled and run in Android, and the flutter doctor in the command line will complain too and won't let you do much.
Yes you can, you want to download VSCode and get the dart & flutter extensions in it, but you need AVD which is provided with Android Studio to run your applications or you can use any other emulator.
Needless to say you also need the Flutter SDK.
You could try https://dartpad.dev/flutter if you're not planning anything big. It's a flutter version of the dart playground and it lets you test some flutter features, but (as far as I know) it's limited to one file only. And you won't be able to use 3rd party libraries too.
I have a portable version of vscode on my Windows PC. I have flutter installed as well. flutter doctor does not detect my VS Code. I'm guessing it is because its not installed via an installer. It was just copy pasted into a folder.
How can I tell flutter where my VSCode is and that it is my preferred editor without installing it (since I do not have admin rights on the PC)? I tried flutter config -h and it only lists the following options
--[no-]analytics Enable or disable reporting anonymously tool usage statistics and crash reports.
--clear-ios-signing-cert Clear the saved development certificate choice used to sign apps for iOS device deployment.
--gradle-dir The gradle install directory.
--android-sdk The Android SDK directory.
--android-studio-dir The Android Studio install directory.
We only look in the default install locations for each platform. You can find the code here:
https://github.com/flutter/flutter/blob/217b2bdaa18de2bfddf213bc920b1337e77f1be3/packages/flutter_tools/lib/src/vscode/vscode.dart#L87-L154
You're not missing out on anything by not having it found, all Doctor does is lists it if it's found and tells you if you're missing the Dart Code extension.