Flutter doctor isn't going well - flutter

After installing flutter sdk, android studio, and flutter plugin..
*1st I copied Android SDK tools manually because android studio didn't download it from web !!
*2nd When I tried to write "flutter doctor" in the command line, it didn't going well, and this is what actually happend.
PS C:\Users\MQ> flutter doctor -v
Got TLS error trying to find package node_preamble at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Got TLS error trying to find package node_preamble at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Got TLS error trying to find package node_preamble at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Running "flutter pub get" in flutter_tools...
|

I had same issue, I changed my network connection but I have had same issue. So to resolve this problem I changed flutter version to 1.22.6, This version works for me and I didn't get these errors with this version.

Related

ui.TextLeadingDistribution not found when running Flutter app on chrome or macos

When trying to run my app on chrome or macos after using dart migrate, I get this errors in the console:
Downloading Web SDK... 2,674ms
Launching lib/web/main.dev.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:38:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:98:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:219:3: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? get leadingDistribution =>
It runs fine on the Android / iPhone emulators.
I tried the following but all in vain:
flutter 2.0.6 (stable)
flutter 2.5.3 (stable)
flutter doctor shows nothing wrong
flutter clean, flutter pub cache repair, flutter pub get
Restart VSCode
Actually, the issue was coming from the dependency styled_text.
I copied only the files that we needed from the repo and that solved the issue.

flutter pub get not working after updating flutter 2.5

Hy hope so all are good and fine! i am new to flutter and after updating flutter version to 2.5 i am facing this type of errors as in images below enter image description here
enter image description here
Error is:
flutter pub get
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Running "flutter pub get" in flutter_application_1...
Just accept android licenses to the run below command on terminal, I also face this problem when I upgrading my flutter and I have solve my issue on below command, hope its help to you
flutter doctor --android-licenses
And accept the terms on the terminal

How to fix get package flutter last version 2.2 on macOs big sur 11.3.1 error

Running "flutter pub get" in car-store...
Got socket error trying to find package rect_getter at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Got socket error trying to find package rect_getter at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Got socket error trying to find package rect_getter at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...

Don't able to run flutter code due to Firebase error

Running "flutter pub get" in state_login...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 8 in 64 seconds...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 9 in 64 seconds...
Could not resolve URL "https://pub.dartlang.org".
pub get failed (server unavailable) -- attempting retry 10 in 64 seconds...
Because state_login depends on firebase_messaging ^20.0.1 which doesn't match any versions, version solving failed.
Running "flutter pub get" in state_login...
pub get failed (1; Because state_login depends on firebase_messaging ^20.0.1 which doesn't match any versions, version solving
failed.)
Check the version of firebase_messaging. The latest version is firebase_messaging: ^6.0.16
Tell me if it works.

Flutter keeps in "Flutter Setup: Running pub upgrade" forever

I recently changed some things in my project ( not in the pubspec.yaml file until then ) and since then, everytime I open the project, a message pops up in the bottom right corner saying "Flutter Setup: Running pub upgrade ".
I tried:
Installing dart and flutter extentions new.
Reinstalling VS-Code
Delete the Versions next to the dependencies and re-adding the newest version of each package.
To reproduce:
clone "https://github.com/IfClause/info_app_project.git" and open in VS-Code.
Thanks!
Output of 'flutter pub upgrade':
Running pub upgrade...
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
Running pub upgrade...
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)
Running pub upgrade...
And so on.
Sometimes there are some mysterious issues with Flutter's cache.
If it is the case, flutter clean && flutter doctor should do it for you.
Also, it can happen to people with poor connections or behind firewalls.