Flutter: "flutter pub get" gets stuck - flutter

I'm trying to get packages, when I run flutter pub get nothing happens or it get stuck
PS C:\Users\user\Desktop\clone\my_app> flutter pub get
Running "flutter pub get" in my_app... /
Tried upgrading flutter.
Tried running it on multiple networks.
when I used flutter pug get --verbose this was the output:
cloud_firestore","homepage":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","repository":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","version":"3.1.0","environment":{"sdk":">=2.16.0
<3.0.0","flutter":">=1.20.0"},"dependencies":{"_flutterfire_internals":"^1.0.9","cloud_firestore_platform_interface":"^5.9.0","collection":"^1.0.0","firebase_core":"^2.3.0","firebase_core_web":"^2.0.1","flutter":{"sdk":"flutter"},"flutter_web_plugins":{"sdk":"flutter"},"js":"^0.6.3"},"dev_dependencies":{"firebase_core_platform_interface":"^4.5.2","flutter_test":{"sdk":"flutter"},"mockito":"^5.0.0"},"flutter":{"plugin":{"platforms":{"web":{"pluginClass":"FirebaseFirestoreWeb","fileName":"cloud_firestore_web.dart"}}}}},"archive_url":"https://pub.dartlang.org/packages/cloud_firestore_web/versions/3.1.0.tar.gz","archive_sha256":"3c9a77380e6a053129c2cb6dbe8ef1b708f4350ce0dad220d2c05cd68a2d467f","published":"2022-11-17T14:00:52.599889Z"},{"version":"3.1.1","pubspec":{"name":"cloud_firestore_web","description":"The web implementation of
cloud_firestore","homepage":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","repository":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","version":"3.1.1","environment":{"sdk":">=2.16.0
<3.0.0","flutter":">=1.20.0"},"dependencies":{"_flutterfire_internals":"^1.0.10","cloud_firestore_platform_interface":"^5.9.1","collection":"^1.0.0","firebase_core":"^2.4.0","firebase_core_web":"^2.0.2","flutter":{"sdk":"flutter"},"flutter_web_plugins":{"sdk":"flutter"},"js":"^0.6.3"},"dev_dependencies":{"firebase_core_platform_interface":"^4.5.2","flutter_test":{"sdk":"flutter"},"mockito":"^5.0.0"},"flutter":{"plugin":{"platforms":{"web":{"pluginClass":"FirebaseFirestoreWeb","fileName":"cloud_firestore_web.dart"}}}}},"archive_url":"https://pub.dartlang.org/packages/cloud_firestore_web/versions/3.1.1.tar.gz","archive_sha256":"b6a5712dc5d74473249b0777b93e6adf0ae68aeabae2699238d4647f3d5e1624","published":"2022-12-08T14:07:35.355432Z"},{"version":"3.2.0","pubspec":{"name":"cloud_firestore_web","description":"The web implementation of
cloud_firestore","homepage":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","repository":"https://github.com/firebase/flutterfire/tree/master/packages/cloud_firestore/cloud_firestore_web","version":"3.2.0","environment":{"sdk":">=2.16.0
<3.0.0","flutter":">=1.20.0"},"dependencies":{"_flutterfire_internals":"^1.0.11","cloud_firestore_platform_interface":"^5.10.0","collection":"^1.0.0","firebase_core":"^2.4.0","firebase_core_web":"^2.0.2","flutter":{"sdk":"flutter"},"flutter_web_plugins":{"sdk":"flutter"},"js":"^0.6.3"},"dev_dependencies":{"firebase_core_platform_interface":"^4.5.2","flutter_test":{"sdk":"flutter"},"mockito":"^5.0.0"},"flutter":{"plugin":{"platforms":{"web":{"pluginClass":"FirebaseFirestoreWeb","fileName":"cloud_firestore_web.dart"}}}}},"archive_url":"https://pub.dartlang.org/packages/cloud_firestore_web/versions/3.2.0.tar.gz","archive_sha256":"2d7339bf3f79adcdb123a88e908474478b060317332189bdd5dcb2d498952127","published":"2022-12-22T12:35:55.126423Z"}],"_fetchedAt":"2022-12-28T11:16:24.333312"}
This is the last 6 lines I get
any kind of help will be appreciated.

Related

Build failed with an exception

while running the code got this error. I tried to reinstall the flutter ,but did not work
It looks more like a Java error,
Just to have a clear conscience, i would suggest you to run the very classic
flutter clean
and then
flutter pub get
if you're using build_runner in your project, run:
flutter pub run build_runner build --delete-conflicting-outputs
Restart your computer, it worked for some people with the same problem (Linked at the end).
If nothing of this works, reinstall your Java.
Check this for more info:
Cannot create service of type TaskExecuter using ProjectExecutionServices
https://github.com/gradle/gradle/issues/12436#issuecomment-678389275

Could not find a file named "pubspec.yaml"

hi friends how to solve this error,i'm just running this command flutter:
Flutter doctor -v,
flutter pub cache clean ,
flutter pub cache repair,
flutter packages pub get,
flutter clean,
dart pub get ,
flutter pub get,
i'm getting an error
Could not find a file named "pubspec.yaml" in "E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".
Running "flutter pub get" in flutter_tools...
pub get failed (66; Could not find a file named "pubspec.yaml" in
"E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".)
I had this same issue. Really frustrating.I deleted the pub.dartlang.org folder.
On Mac, in finder command + shift + G | pasted the path from the console | opened in finder and removed the folder.
after deleting the folder
run
Pub get
pub outdated / upgrade
pod repo update
pod update
This fixed my issue and allowed me to build the app.

pub run build_runner build has error (66)

hey guys i have error after using command : flutter pub run build_runner build
error message :
C:\Users\matin\AndroidStudioProjects\mosito>flutter pub run build_runner build
Could not find a file named "pubspec.yaml" in "C:\Users\matin\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\async-2.8.1".
pub finished with exit code 66
i try flutter pub upgrade and a lot of things from google but problem not fixed
NOTE: im new to flutter i want use this command for making .g.dart file for my models thanks for your attention
I think may be you are not in your project directory. Suppose you have a project name A in myfolder in C drive of your computer. First goto myfolder with terminal. after that try below code to build the project...
flutter packages pub run build_runner build --delete-conflicting-outputs
Turn on Your Terminal and Run
flutter doctor
if it is showing
Could not find "flutter"
Then you need to install flutter Correctly You Can check :
https://docs.flutter.dev/get-started/install/windows

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

"zsh: command not found: pub" while testing my code for exercism

I want to test my coding exercise for exercism.io. On the Intellij IDEA and Android Studio when I try to type on terminal "$ pub get" and "$ pub run test". I get this error "zsh: command not found: pub or $". I've been stacking here for 2 days. What should I do?
My System: Mac OS Catalina version 10.15.3.
My Android SDK is located: Users/vortovor/Developer/flutter/bin/cache
in cache there is a file named "dart-sdk".
You may want to use the pub shipped with the Flutter version you're using as told on the pub tool section of Dart documentation:
Flutter note: If you’re using the Flutter SDK, don’t use the pub command directly. Instead use the flutter pub command, (...)
flutter pub get
# or
flutter pub test