Reputation: 195
When I run in terminal flutter pub get
is stuck it's showing
OS MacOS Catalina 10.15.3
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
Upvotes: 15
Views: 46427
Reputation: 460
If its a git error, use this command:
git config --global url."https://".insteadOf git://
Upvotes: 3
Reputation: 679
make sure there is no typo in pubpspec.yaml
check it on here https://stackoverflow.com/a/72198419/8122500
Upvotes: 1
Reputation: 1
I was able to resolve it by using Visual Studio Debuggable Package Manager PowerShell, on your system open visual studio debuggable package manager and then type in flutter doctor it will resolve it within seconds
Upvotes: 0
Reputation: 1
Because restaurant depends on flutter any from sdk which doesn't exist (unknown SDK "flutter"), version solving failed
fix proplem done change this package this path prev last path_provider_windows:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/lib/ change path fluatter plus /all path path_provider_windows:file:///C:/all/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/lib/ its ok thanks
Upvotes: 0
Reputation: 11
hmm, i know how frustrating it can be trying to solve the issue, the best solution to this is to use vpn and connect to another server. this way i was able to solve the problem without stress
Upvotes: 1
Reputation: 260
I´ve solved it on my Windows machine.
After many tries from answers in many discussions out there, I tried a lot of stuff, like:
Restarting the machine
Deleting the cache folder (the dart-sdk download may be restarted)
Adding dart-sdk in the Environment Variable Path
X:\Dev\Flutter\bin\cache\dart-sdk\
Adding dart-sdk´s bin folder in the Path variable (for both Environment and User Variables) (desperate action, I know)
X:\Dev\Flutter\bin\cache\dart-sdk\bin
And still didn´t work.
BUT... I´ve found on this thread something about a proxy problem.
Then I´ve decided to try it out on my Windows machine, and it worked (finally).
Try typing this on Power Shell:
$Env:https_proxy="your.proxy.here:8080"
Then try flutter doctor
again
Upvotes: 2
Reputation: 29
In my case it was my virus program (AVG AntiVirus' Web Shield) that suddenly caused pub get to fail.
Upvotes: 0
Reputation: 155
Make sure no firewall is blocking it.
Check for Internet connectivity too. Search your browser, don't rely on the windows wifi symbol.
For me, KIS (Kaspersky) was blocking pub.bat. If that is the case please also check---- Flutter, dart, android studio, Gradlew.bat, sdkmanager.bat, adb.exe, qemu-systems, emulator-check and google for any blockage. (just search in firewall settings).
Upvotes: 0
Reputation: 1569
502 Bad Gateway trying to find package package_name at https://pub.dartlang.org. If you click on the link, you'll find that the website is down. The same is also applied to https://pub.dev/.
Upvotes: 2
Reputation: 800
As said it might be something that has to do with your network.... Disconnecting and reconnecting fixed mine.
Upvotes: 0
Reputation: 64
In my case, The host of my ISP was blocked so it could not get the package and it was showing pub get failed (server unavailable) -- attempting retry 1 in 1 second...
So I turn on my VPN and tried once again and this time it was a success
Upvotes: 4
Reputation: 217
Quick fixes before explanation:
So, I had (and sometime still having) the same issue. I've analyzed it and came to a conclusion that the package download manager and the server that hosts those packages aren't reliabe at all. Very small packages might just successfully be imported with "flutter pub get", whereas big ones might last forever to download. This is definately a networking issue, on either yours or their side.
Just for verificatioin that we are indeed experiencing the same issue:
open your cmd (no matter t OS) and run: ping -t pub.dev .Now, if you see those inconsitent replies from the server, it means there's something wrong with the network (yours or their side). This looks something like this:
If you wait for a relatively large amount of time (10 minutes I would say is enough) and the connectivity issue is still not resolved, you will see the following msg from flutter: "Process finished with exit code 0".
I suggest you try another time or maually add the package.
p.s: it doesn't happen with all of the packages and from my investigation is seems to be related to the size of it. e.g, I managed to get the carousela_flutter 0.7.0 package, but the 1.4.1 failed.
Upvotes: 10