Update Dart DevTools - flutter

I'm currently on flutter 1.22.4 with dart devtools on 0.9.3+4, but https://pub.dev/packages/devtools/install has it at 0.9.5. My current version doesn't have the response body in the network tab and I'm trying to update to a newer version and I don't know how to.

First, run flutter -doctor and see if there are any errors. Then try running "flutter pub get" if that doesn't do the trick upgrade your tools and run flutter -clean and try again.

Related

Visual Studio Code Can't Run Flutter - looking at wrong dart version

I have created a new flutter Project, but when I run it on Visual Studio Code by clicking on "Start Debugging" the following errors pops up:
[button_test] flutter pub get
Running "flutter pub get" in button_test...
The current Dart SDK version is 2.17.6.
Because button_test requires SDK version >=2.18.4 <3.0.0, version solving failed.
pub get failed (1; Because button_test requires SDK version >=2.18.4 <3.0.0, version solving failed.)
exit code 1
So I've double checked the dart version by entering dart --version. But this came back as 2.18.6
The funny thing is that if I enter flutter run on the Terminal, it works no problem. As I've installed the flutter and dart extension, I believe this is a problem with those extension? With that said, is there a way to fix which version of dart it's looking at?
Thanks
Step 1:
Open terminal and Navigate to the flutter location
cd <flutter_path>
Step 2:
Now enter the command
git checkout
You can find all the releases from this link https://docs.flutter.dev/development/tools/sdk/releases
Step 3:
Now run flutter doctor -v command so flutter will download the stuff related to the particular version
flutter doctor -v
Once the flutter doctor command is successful you can go ahead and enjoy the version you wish

Failed to start DevTools: Dart DevTools exited with code 255

I am getting this error code in my Visual Studio Code. How can I fix it?
I am using Flutter v2.5.3.
You can try fixing it by running this in the terminal:
Just copy and paste the below code into the terminal and run it.
dart pub global activate devtools -v 2.8.0
which downgrades the version to 2.8.0 (that works fine). I found the answer on GitHub.
I agree with RandomCoder's answer to avoid executing command
dart pub global activate devtools -v 2.8.0
every time before opening Visual Studio Code.
And also if you didn't know the location of the build folder mentioned by RandomCoder, I found the location after reading it here for the pub cache folder:
By default, this directory is located under . pub-cache in your home directory (on macOS and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows). (The precise location of the cache may vary depending on the Windows version.)
After you found it, go to the \hosted\pub.dartlang.org\devtools-2.8.0 directory to copy the build version there and paste it in \hosted\pub.dartlang.org\devtools-2.9.2.
I still didn't know if there is any bad effects of copy pasting it to a newer version folder, but in my case it's working until now.
In my case there wasn’t any build folder in the devtools-2.9.2 folder.
I copied it from 2.8.0 and it now works.
For Android Studio
Close Android Studio
Rn dart pub global activate devtools -v 2.8.0 to downgrade (as suggested in a previous answer)
Open Android Studio
Run your build
For Visual Studio Code
Open Terminal
Run dart pub global activate devtools -v 2.8.0 to downgrade (as suggested a previous answer)
I fix this by:
flutter upgrade
This is an issue coming since yesterday. Maybe they must have updated the Dart engine.
There are two ways which will help you to solve the issue.
Update the Flutter SDK to the latest version and restart your PC:
flutter upgrade
Use the Dart Devtools manually
Run flutter pub global in another terminal. Run devtools and then open http://127.0.0.1:9100
Enter a running application field address of your running application in the Connect: "http://127.0.0.1:60230/J7_wS_YhTuo=/"
You can find this URL in debug console when you run the code.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:51849/mHlycLJYEWw=/ws
If you are getting any issue regarding the port, then do this in your Flutter project console
flutter run --observatory-port=9100
Once the application starts you can see the message in the console.
If you are getting any server issue in the web browser
then enter
dart devtools
In cmd
Downgrade to devtools-2.8.0
And activate using dart pub global activate devtools -v 2.8.0
These two steps worked in my case
First activate your devtool using this command...
flutter pub global activate devtools
flutter pub global run devtools
And after that, try launching it from Visual Studio Code as described in the documentation: Install and run DevTools from VS Code

Could not find an option named "devtools-server-address". when trying to run flutter app from AndroidStudio

I just updated Flutter plugin to 53.0.1, restarted Android Studio and hit "run" button and the error below show up:
Could not find an option named "devtools-server-address".
Close and reopen AndroidStudio resolved for me!
killall java
I downgraded from Flutter 2.0 to Flutter 1.22.5 and got this error.
To solve it,
Go to your terminal and write flutter channel stable.
Then run flutter doctor.
Now you may get another error like this -
If you have Flutter & Dart plugins already install, just ignore this error. This is a bug in Flutter 1.22.5 .
Just run the app and it will work fine!
I had the same issue but using VS Code on stable channel
Execute the following commands:
flutter channel stable
flutter upgrade
flutter clean
flutter pub get
Then, close and open your IDE
Follow the steps:
File -> Invalidate Cache and Restart. Run flutter clean Worked For me.
This so simple... Open terminal type flutter channel dev this solve your problem.
And after that flutter upgrade
Finally, flutter doctor
If it does not help:
Open terminal type flutter channel stable
And after that flutter upgrade
Finally, flutter doctor
Working without upgrading flutter
Safe fix for Mac (Android Studio 4.1+). It is in a different directory now, but the symbolic link helps.
Just run this command in the Terminal:
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Change the version of the Android studio depending on what you have, I had 4.2 so used.
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.2/plugins ~/Library/Application\ Support/AndroidStudio4.2
Just Invalidate Cache and Restart. Worked for me.
Just close your all project and also close Android Studio and Reopen.

VSCode - Target of URI doesn't exist: 'package:english_words/english_words.dart'

I just got started with Flutter, following the google codelab for First Flutter Application.
I have tried all the previously answered solutions but none have worked for me.
Tried:
flutter packages get,
flutter packages upgrade,
flutter pub get,
flutter upgrade,
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
Flutter and Dart Plugins are installed in Android Studio as well.
Restarted multiple times too.
english_words-3.1.5 package is already present in .packages
Attaching Screenshot links for reference
Try running flutter clean from your Vs Code terminal.
Then restart.

Flutter Dart on windows 10

When I am running any command that uses dart the response is always as follows;
building flutter tool...
Running Pub upgrade...
The current Dart SDK version is 2.10.0-0.0.dev.flutter-9dca49e71e.
Because flutter_tools depends on collection >=1.15.0-nnbd <1.15.0-nullsafety.2 which requires SDK version >=2.9.0-18.0 <=2.9.10, version solving failed.
I am not able to switch the version nor the channel as those commands run through the same response.
I tried to uninstall flutter and dart, but I have only gotten back to the same issues.
Any help?
Navigate to where to your flutter install directory e.g. C:\Tools\Flutter and do a git pull.
After that you should be able to run any command, such as flutter --help and the Dart SDK will be on the correct version.
This can be verified by running flutter upgrade
I just needed to update my Path ENV Variable