Flutter doesn't build new code and keep the outdated
I have a problem..flutter doesn't build new code with hot reload nor restart ..every time I have to delete build folder, run flutter clean and run flutter pub get && flutter run and this happen with any new project I create
Beside that, These command doesn't work in vscode terminal it must be Linux terminal..when i run flutter doctor in Linux terminal it works fine but in vscode terminal it says:
[✗] Android toolchain - develop for Android devices
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
however i have installed cmdline-tools and all sdk tools from Android Studio.
I tried to uninstall vscode and flutter and reinstall them but the issues are still the same.
Related
I created a sample flutter project and I want to see the result in chrome.
when I run main.dart on chrome I get a white blank page as result!
here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
Flutter (Channel stable, 3.3.0, on Ubuntu 22.04.1 LTS 5.15.0-56-
generic,locale en_US.UTF-8)
Android toolchain - develop for Android devices
cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more
details.
Chrome - develop for the web
Linux toolchain - develop for Linux desktop
clang++ is required for Linux development.
It is likely available from your distribution (e.g.: apt
install clang), or can be downloaded from
https://releases.llvm.org/
CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt
install cmake), or can be downloaded from
https://cmake.org/download/
ninja is required for Linux development.
It is likely available from your distribution (e.g.: apt
install ninja-build), or can be downloaded from
https://github.com/ninja-build/ninja/releases
pkg-config is required for Linux development.
It is likely available from your distribution (e.g.: apt
install pkg-config), or can be downloaded from
https://www.freedesktop.org/wiki/Software/pkg-config/
Android Studio
android-studio-dir =
/home/mbunderline76/.local/share/JetBrains/Toolbox/apps/IDEA-
U/ch-0
Unable to find bundled Java version.
IntelliJ IDEA Ultimate Edition (version 2022.3)
Connected device (2 available)
HTTP Host Availability
Doctor found issues in 3 categories.
any idea what is going on?
by the way i'm using Intellij Idea Ultimate
Fix these issues first.
Flutter command Line tools
Flutter Java Bundled Link
then again run flutter doctor to make sure these errors are gone.
then run flutter -v -d chrome run Or Pick " Chrome Web " in your Vscode or AndroidStudio.
Hope this works, Enjoy.
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 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 .
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.
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