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
Related
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....
I was developing a Flutter app using the stable channel, in Android Studio, now I upgraded Flutter Plugin to 53 and now when I try to run my app I receive this error
Could not find an option named "devtools-server-address".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Someone suggested using the dev channel, but I need to continue in the stable channel!
Suggestion Link:
Could not find an option named "devtools-server-address". when trying to run flutter app from AndroidStudio
Just found the fix:
$ flutter upgrade
$ flutter clean
Then select Invalidate Caches / Restart from the Android Studio File menu!
Follow the following steps:
Run the command flutter clean from terminal.
Go to File -> Invalidate Cache and Restart -> Invalidate and Restart.
Now try running your app. The issue should disappear.
If the error still persists: Go to File -> Settings -> Language & frameworks -> Flutter.
Check that the sdk path is appropriate as shown in below image:
Check the Dart sdk path too:
This should solve your problem.
Follow the steps:
File -> Invalidate Cache and Restart.
Run flutter clean
Worked For me.
For a little bit more details, you could also run flutter doctor to see what is happening.
In my case, I've recently updated Android Studio to version 4.2 and when I run the command it gives me:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.6, on macOS 11.2.2 20D80 darwin-x64, locale en-GI)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2020.1.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 3 categories.
As well you could run flutter doctor -v as specified to get more details as verbose (where -v stands for verbose)
In my case the plugins where not visible for Android Studio and wasn't using a stable version of Flutter which didn't allow me to enable the plugins, although they were installed.
After this I've switched to a stable version of Flutter, double checked any required updated from Android Studio, uninstall and re-install the plugins and worked like a charm.
Want to mention that flutter clean and flutter pub get were necesarry afterwards.
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.
I am not using GIT. As i have seen some posts/questions where users are mentioning they are using GIT and due to that they are getting the error.
Yesterday, I added Image Cropper Plugin and then I restarted the machine. After the restart, it starts giving the error.
The current Flutter SDK version is 0.0.0-unknown.
Because image_cropper 1.2.1 requires Flutter SDK version ^1.12.13 and no versions of image_cropper match >1.2.1 <2.0.0, image_cropper ^1.2.1 is forbidden.
So, because demoapp depends on image_cropper ^1.2.1, version solving failed.
pub get failed (1; So, because demoapp depends on image_cropper ^1.2.1, version solving failed.)
Exited (1)
I run Flutter version command -> Below is the output.
Flutter 1.12.13+hotfix.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f139b11009 (6 weeks ago) • 2020-03-30 13:57:30 -0700
Engine • revision af51afceb8
Tools • Dart 2.7.2
I did Flutter Clean and Flutter Pub Get they both didn't fix the issue.
I run Flutter Doctor and here is the output.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.3 19D76, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the
Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
I am not using Xcode from the beginning.
Any advice on how to fix this issue.
Edit
I checked the path by running echo $PATH.
/Users/rahul/Desktop/flutter/bin
Path is also there.
Edit 2
Flutter Upgrade also didn't helped.
First Restart your system.
Open your downloaded Flutter SDK zip folder (folder you get when you download flutter sdk from official website) and copy packed-refs and config file which is under <flutter_windows_1.22.5-stable.zip\flutter.git> folder
Remove these two files from the existing flutter sdk location in your system(which you extracted earlier) and paste these files again.
Again open android studio and try again by clicking Get dependencies button.
Click on run application.
App will run successfully.
for the new git version you need to config the path of your projet like this
git config --global --add safe.directory D:/path_were_flutter_is_locate/flutter
if it happened to you on Mac OS just install homebrew like on the description on
https://brew.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
then install git
brew install git
I faced this error because I have multiple user on my system so when i trying to run my project from not-admin user i get this error. i resolved it by using this command
git config --global --add safe.directory C:/flutter
"C:/flutter": is your flutter sdk folder path
Try running flutter doctor if it still shows the flutter version is 0.0.0-unknown, Then mostly your flutter installation is corrupted.
Please follow the steps mentioned in the below link.
https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#flutter-installation-corrupted
Try running git checkout stable in your flutter installation folder.
I had same issue in Windows and this fix works for me
(Sorry if my english is bad :( )
my flutter installation was git clone --depth=1
so I removed the whole dir: rm -rf flutter
then git clone once again. this time the full repository.
I think it solved the issue.
pub get works again, and flutter can build/run.
The flutter tool determines the Flutter SDK version from the Git tags in your local Flutter Git repository. If you've created a shallow Git clone (i.e., used something like git clone --depth=... or done other manipulations to your Git repository that lost the tag information, the flutter tool will be unable to determine the version number and will report 0.0.0-unknown.
If you find yourself in this state, your best course of action would be to reinstall the Flutter SDK in a supported way (i.e., by following the installation instructions).
After uninstalling and reinstalling flutter you have to create a new flutter app using flutter create app-name. trying to work on the same project will not solve the issue.
This problem fed me up for days.
How i solved this is issue is that i just upgraded the flutter and then deleted the current project while copying the code and created a new project and then pasted the code to the new project
Hurray the issue was solved!!!
for me its due to different issue. Where i should run flutter as normal user not admin. hope this helps.
Go to github page of flutter_image_cropper package, fork it in your space, then change its sdk requirement in its pubspec.yaml file, commit it, push it, now in your project, while importing this package, provide path of your github link to your forked repository ending with .git. It will work perfectly.
Also you can refer Github page for common issues
I'm building flutter web project and after implenting login page via firebase I ran flutter run -d chrome.
But it's stuck while attempting to connect to browser, its just attempting for endless time without giving any error messages. Status bar:
λ flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Building application for the web... 20,2s
Attempting to connect to browser instance..
(This is taking an unexpectedly long time.) \
Flutter doctor:
λ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.10.11-pre.2, on Microsoft Windows [Version 10.0.18362.356], locale ru-RU)
[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/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[√] Chrome - develop for the web
[!] Android Studio (not installed)
[√] VS Code (version 1.38.1)
[√] Connected device (2 available)
! Doctor found issues in 2 categories.
pubspec.yaml:
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase: ^5.0.0
firebase_auth:
Try with flutter run -d web-server, then open URL on Chrome manually.
Remove all unused dependencies
flutter run -d web-server
The answer mentioned by #Giampaolo is a great workaround!
Same issue here. When trying the sample project, it works. I think the problem has something to do with dependencies, but have not figured out in detail.
Update:
Could be related: https://github.com/flutter/flutter/issues/40876
and https://github.com/flutter/flutter/issues/39998
Update #2:
I could reproduce the issue a described in
https://github.com/flutter/flutter/issues/39998
1) Create fresh flutter project with web support -> works.
2) add import 'dart:io'; to main.dart -> blank screen
Same issue . It wasn't able to get the instance of browser.
I tried removing unused imports, in my case "import 'dart:ffi';" this was the unused import and ta daa ... it worked !!!.
i just don't know what exactly the problm was.
Same issue: It use to take lot of time to load and 'r', the hot reload command never worked.
For me cleaning builds by "flutter clean" did the magic.
I have fixed that issue by installing the latest JDK and JRE and added both path to environment variables. it fixes my flutter speed but flutter run and apk building still taking the same.